Opened 5 years ago

Closed 5 years ago

#30594 closed New feature (fixed)

Add Cache-Control: private to never_cache decorator.

Reported by: Naoki SASAKI Owned by: Naoki SASAKI
Component: Core (Cache system) Version: dev
Severity: Normal Keywords: cache
Cc: Naoki SASAKI, Florian Apolloner Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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,

Change History (5)

comment:1 by Naoki SASAKI, 5 years ago

Cc: Naoki SASAKI added
Needs documentation: set

comment:2 by Mariusz Felisiak, 5 years ago

Cc: Florian Apolloner added
Component: UtilitiesCore (Cache system)
Has patch: set
Owner: changed from nobody to Naoki SASAKI
Status: newassigned
Summary: Add Cache-Control: private to never_cache decoratorAdd Cache-Control: private to never_cache decorator.
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug

Thanks for the report. Sounds reasonable, due to the 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.

PR

comment:3 by Mariusz Felisiak, 5 years ago

Type: BugNew feature

comment:4 by Mariusz Felisiak, 5 years ago

Needs documentation: unset

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In a289e796:

Fixed #30594 -- Added 'private' Cache-Control directive to never_cache() decorator.

Note: See TracTickets for help on using tickets.
Back to Top