[Django] #30594: Add Cache-Control: private to never_cache decorator

60 views
Skip to first unread message

Django

unread,
Jun 26, 2019, 12:19:47 AM6/26/19
to django-...@googlegroups.com
#30594: Add Cache-Control: private to never_cache decorator
-----------------------------------------+------------------------
Reporter: nsasaki128 | Owner: nobody
Type: Uncategorized | Status: new
Component: Utilities | Version: master
Severity: Normal | Keywords: cache
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
If a Django user wants to ensure that a resource is not cached.
The user might use never_cache decorator, however, sometimes it doesn't
work as he or she expected, which means the resource is cached by CDN.
The reason why is that CDN providers cache the resource. For example,
Fastly needs to set Cache-Control: private for HTTP header with the origin
response. The document is below.
https://docs.fastly.com/guides/tutorials/cache-control-tutorial#do-not-
cache

Currently Django's never_cache lacks Cache-Control: private, so I suggest
to add this header to a response.

Thanks,

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

Django

unread,
Jun 26, 2019, 1:13:44 AM6/26/19
to django-...@googlegroups.com
#30594: Add Cache-Control: private to never_cache decorator
-------------------------------+--------------------------------------

Reporter: nsasaki128 | Owner: nobody
Type: Uncategorized | Status: new
Component: Utilities | Version: master
Severity: Normal | Resolution:

Keywords: cache | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 1

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

* cc: nsasaki128 (added)
* needs_docs: 0 => 1


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

Django

unread,
Jun 26, 2019, 1:55:37 AM6/26/19
to django-...@googlegroups.com
#30594: Add Cache-Control: private to never_cache decorator.
-------------------------------------+-------------------------------------
Reporter: nsasaki128 | Owner:
| nsasaki128
Type: Bug | Status: assigned
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: cache | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

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

* status: new => assigned
* cc: Florian Apolloner (added)
* component: Utilities => Core (Cache system)
* owner: nobody => nsasaki128
* has_patch: 0 => 1
* type: Uncategorized => Bug
* stage: Unreviewed => Accepted


Comment:

Thanks for the report. Sounds reasonable, due to the
[https://tools.ietf.org/html/rfc2616#section-14.9.1 rfc2616]:
> "private" - Indicates that all or part of the response message is
intended for a single user and MUST NOT be cached by a shared cache.


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

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

Django

unread,
Jun 26, 2019, 2:28:34 AM6/26/19
to django-...@googlegroups.com
#30594: Add Cache-Control: private to never_cache decorator.
-------------------------------------+-------------------------------------
Reporter: nsasaki128 | Owner:
| nsasaki128
Type: New feature | Status: assigned

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

* type: Bug => New feature


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

Django

unread,
Jun 26, 2019, 3:27:10 AM6/26/19
to django-...@googlegroups.com
#30594: Add Cache-Control: private to never_cache decorator.
-------------------------------------+-------------------------------------
Reporter: nsasaki128 | Owner:
| nsasaki128
Type: New feature | Status: assigned
Component: Core (Cache system) | Version: master
Severity: Normal | Resolution:
Keywords: cache | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

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

* needs_docs: 1 => 0


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

Django

unread,
Jun 26, 2019, 3:47:00 AM6/26/19
to django-...@googlegroups.com
#30594: Add Cache-Control: private to never_cache decorator.
-------------------------------------+-------------------------------------
Reporter: nsasaki128 | Owner:
| nsasaki128
Type: New feature | Status: closed

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

Keywords: cache | 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:"a289e7967907f47e8aba2b25e5f397af6ac7dac9" a289e796]:
{{{
#!CommitTicketReference repository=""
revision="a289e7967907f47e8aba2b25e5f397af6ac7dac9"
Fixed #30594 -- Added 'private' Cache-Control directive to never_cache()
decorator.
}}}

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

Reply all
Reply to author
Forward
0 new messages