Re: [Django] #13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'

80 views
Skip to first unread message

Django

unread,
Jul 6, 2012, 12:24:59 PM7/6/12
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'
-------------------------------------+------------------------------------
Reporter: harm | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by eykd):

Shouldn't this also set the `Pragma: no-cache` header?

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 9, 2012, 4:16:22 AM7/9/12
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'
-------------------------------------+------------------------------------
Reporter: harm | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by harm):

I think it should not be needed. {{{ Pragma: no-cache }}} is intended for
http requests, not http responses. (See
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9)

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:10>

Django

unread,
Jul 18, 2012, 8:02:12 PM7/18/12
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'
-------------------------------------+------------------------------------
Reporter: harm | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by SmileyChris):

More explicitly,
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.32 says:
> Note: because the meaning of "Pragma: no-cache as a response
> header field is not actually specified, it does not provide a
> reliable replacement for "Cache-Control: no-cache" in a response

I can't see `must-revalidate` being necessary, either. But maybe I'm
overlooking something.

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:11>

Django

unread,
Nov 18, 2012, 12:40:36 AM11/18/12
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'
-------------------------------------+------------------------------------
Reporter: harm | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by net147):

* cc: net147 (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:12>

Django

unread,
Mar 21, 2013, 4:41:35 AM3/21/13
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'
-------------------------------------+------------------------------------
Reporter: harm | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by harm):

confirmed, {{{must-revalidate}}} is not necessary.

tested adding cache control headers with
{{{
@cache_control(max_age=0, no_cache=True, no_store=True)
}}}

on FF 19.0 + FF 19.02 + chrome 25 (on mac)
A 'back' button in the browser, reloads a view.

So I think your patch
[https://code.djangoproject.com/attachment/ticket/13008/13008.diff
13008.diff] is correct.

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:13>

Django

unread,
Mar 21, 2013, 4:42:54 AM3/21/13
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'must-revalidate'
-------------------------------------+------------------------------------
Reporter: harm | Owner: nobody
Type: Bug | Status: new
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by harm):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:14>

Django

unread,
Oct 17, 2013, 3:03:32 AM10/17/13
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+------------------------------------
Reporter: harm | Owner: susan
Type: Bug | Status: assigned

Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by susan):

* owner: nobody => susan
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:15>

Django

unread,
Oct 17, 2013, 3:25:03 AM10/17/13
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+------------------------------------
Reporter: harm | Owner: susan
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by susan):

Where should I write a test? Should it be in `cache/tests.py`? The
function `add_never_cache_headers` is never tested in the`tests/`
directory.

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:16>

Django

unread,
Nov 3, 2014, 10:22:57 AM11/3/14
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+------------------------------------
Reporter: harm | Owner: susan
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------

Comment (by thenewguy):

This issue is related to https://code.djangoproject.com/ticket/23755
(patch_cache_control should special case "no-cache")

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:17>

Django

unread,
Apr 26, 2015, 1:20:46 PM4/26/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau

Type: Bug | Status: assigned
Component: Core (Cache system) | Version: 1.2-beta
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by mbertheau):

* owner: susan => mbertheau


Comment:

PR with test in https://github.com/django/django/pull/4565

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:18>

Django

unread,
Apr 26, 2015, 1:49:01 PM4/26/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by MarkusH):

* version: 1.2-beta => master
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:19>

Django

unread,
Apr 27, 2015, 11:51:29 AM4/27/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* stage: Accepted => Ready for checkin


Comment:

The patch looks rather good. Tim, a last review?

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:20>

Django

unread,
Apr 28, 2015, 12:07:45 PM4/28/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau
Type: Bug | Status: closed

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"4a438e400b7ce0ab9d0b6876196cbe8d620a4171" 4a438e4]:
{{{
#!CommitTicketReference repository=""
revision="4a438e400b7ce0ab9d0b6876196cbe8d620a4171"
Fixed #13008 -- Added more Cache-Control headers to never_cache()
decorator.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:21>

Django

unread,
Dec 24, 2015, 11:26:40 AM12/24/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau
Type: Bug | Status: closed
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b51086d57313e7ea857f4b96b62d25e600ee0a8d" b51086d]:
{{{
#!CommitTicketReference repository=""
revision="b51086d57313e7ea857f4b96b62d25e600ee0a8d"
[1.8.x] Fixed #13008 -- Added more Cache-Control headers to never_cache()
decorator.

Backport of 4a438e400b7ce0ab9d0b6876196cbe8d620a4171 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:22>

Django

unread,
Dec 24, 2015, 11:38:46 AM12/24/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau
Type: Bug | Status: closed
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a53175392ff753cc53a4a2d33a5852d113e67363" a5317539]:
{{{
#!CommitTicketReference repository=""
revision="a53175392ff753cc53a4a2d33a5852d113e67363"
Refs #13008 -- Forwardported 1.8.8 release note.

Forwardport of b51086d57313e7ea857f4b96b62d25e600ee0a8d from stable/1.8.x
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:23>

Django

unread,
Dec 24, 2015, 11:39:08 AM12/24/15
to django-...@googlegroups.com
#13008: @never_cache decorator should add 'no-cache' & 'no-store'
-------------------------------------+-------------------------------------
Reporter: harm | Owner: mbertheau
Type: Bug | Status: closed
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"85159b98196e129e6ad493b503f3b49012c280ff" 85159b9]:
{{{
#!CommitTicketReference repository=""
revision="85159b98196e129e6ad493b503f3b49012c280ff"
[1.9.x] Refs #13008 -- Forwardported 1.8.8 release note.

Forwardport of b51086d57313e7ea857f4b96b62d25e600ee0a8d from stable/1.8.x
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/13008#comment:24>

Reply all
Reply to author
Forward
0 new messages