[Django] #23755: patch_cache_control should special case "no-cache"

48 views
Skip to first unread message

Django

unread,
Nov 3, 2014, 10:20:18 AM11/3/14
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------+--------------------
Reporter: thenewguy | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
From my cursory reading of
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html, it looks like
patch_cache_control needs to special case "no-cache".


{{{
no-cache
If the no-cache directive does not specify a field-name, then a cache MUST
NOT use the response to satisfy a subsequent request without successful
revalidation with the origin server. This allows an origin server to
prevent caching even by caches that have been configured to return stale
responses to client requests.
If the no-cache directive does specify one or more field-names, then a
cache MAY use the response to satisfy a subsequent request, subject to any
other restrictions on caching. However, the specified field-name(s) MUST
NOT be sent in the response to a subsequent request without successful
revalidation with the origin server. This allows an origin server to
prevent the re-use of certain header fields in a response, while still
allowing caching of the rest of the response.
}}}


For example, to integrate a site that uses "Vary: Cookie" with AWS
CloudFront, one must use 'Cache-Control: no-cache="Set-Cookie"' if a
response does not vary by cookie. (I've confirmed this with AWS support
as of 10/31/2014).

patch_cache_control does not treat "no-cache" as a list. If you call
patch_cache_control(response, no_cache="Set-Cookie") and then
patch_cache_control(response, no_cache="foo"), you end up with 'Cache-
Control: no-cache="foo"'

Also, no_cache=True should take precedence over no_cache="foo" regardless
of the order it is applied.

I found Ticket https://code.djangoproject.com/ticket/13008 which proposes
to add "no-cache" to @never_cache. Just wanted to link it here since they
are related.

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

Django

unread,
Nov 3, 2014, 10:21:19 AM11/3/14
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------+--------------------------------------

Reporter: thenewguy | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* cc: wgordonw1@… (added)
* needs_docs: => 0
* needs_tests: => 0
* needs_better_patch: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:1>

Django

unread,
Nov 26, 2014, 6:29:26 PM11/26/14
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+------------------------------------
Reporter: thenewguy | Owner: nobody
Type: New feature | Status: new
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* type: Uncategorized => New feature
* version: 1.7 => master
* component: Uncategorized => Core (Cache system)
* stage: Unreviewed => Accepted


Old description:

New description:

--

--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:2>

Django

unread,
Sep 26, 2019, 3:22:35 PM9/26/19
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+-------------------------------------
Reporter: thenewguy | Owner: Flavio
| Curella
Type: New feature | Status: assigned

Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

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

* owner: nobody => Flavio Curella
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:3>

Django

unread,
Sep 26, 2019, 5:00:38 PM9/26/19
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+-------------------------------------
Reporter: thenewguy | Owner: Flavio
| Curella
Type: New feature | 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 Flavio Curella):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/11829 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:4>

Django

unread,
Oct 3, 2019, 6:29:45 AM10/3/19
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+-------------------------------------
Reporter: thenewguy | Owner: Flavio
| Curella
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1
* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:5>

Django

unread,
Oct 3, 2019, 12:00:33 PM10/3/19
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+-------------------------------------
Reporter: thenewguy | Owner: Flavio
| Curella
Type: New feature | 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 Flavio Curella):

* needs_better_patch: 1 => 0
* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:6>

Django

unread,
Oct 10, 2019, 6:27:10 AM10/10/19
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+-------------------------------------
Reporter: thenewguy | Owner: Flavio
| Curella
Type: New feature | 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
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"9facc9002079d2713bb2591ca01f3aca0b678a00" 9facc900]:
{{{
#!CommitTicketReference repository=""
revision="9facc9002079d2713bb2591ca01f3aca0b678a00"
Refs #23755 -- Added tests for patch_cache_control() with no-cache Cache-
Control directive.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:7>

Django

unread,
Oct 10, 2019, 1:54:19 PM10/10/19
to django-...@googlegroups.com
#23755: patch_cache_control should special case "no-cache"
-------------------------------------+-------------------------------------
Reporter: thenewguy | Owner: Flavio
| Curella
Type: New feature | Status: closed

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

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 Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"ed112fadc1cfa400dbee6080bf82fd7536ea4c72" ed112fad]:
{{{
#!CommitTicketReference repository=""
revision="ed112fadc1cfa400dbee6080bf82fd7536ea4c72"
Fixed #23755 -- Added support for multiple field names in the no-cache
Cache-Control directive to patch_cache_control().

https://tools.ietf.org/html/rfc7234#section-5.2.2.2
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/23755#comment:8>

Reply all
Reply to author
Forward
0 new messages