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 , 5 years ago
Cc: | added |
---|---|
Needs documentation: | set |
comment:2 by , 5 years ago
Cc: | added |
---|---|
Component: | Utilities → Core (Cache system) |
Has patch: | set |
Owner: | changed from | to
Status: | new → assigned |
Summary: | Add Cache-Control: private to never_cache decorator → Add Cache-Control: private to never_cache decorator. |
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Bug |
comment:3 by , 5 years ago
Type: | Bug → New feature |
---|
comment:4 by , 5 years ago
Needs documentation: | unset |
---|
Thanks for the report. Sounds reasonable, due to the rfc2616:
PR