Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#13336 closed (fixed)

Document example for setting HttpResponse headers is misleading because it users wrong cache header

Reported by: dnjuls Owned by: nobody
Component: Documentation Version: master
Severity: Keywords: cache reponse headers
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In the HttpReponse documentation (http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpResponse) exists and example for setting headers in for the HttpResponse object.

The header used in the example responsePragma? = 'no-cache'

This header is intended for use in requests, not responses. See http://en.wikipedia.org/wiki/List_of_HTTP_headers#Avoiding_caching
Better use Cache-Control: no-cache

Attachments (1)

13336.patch (452 bytes) - added by Claude Paroz 7 years ago.
Trivial patch to replace Pragma by Cache-Control

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by Russell Keith-Magee

milestone: 1.2
Triage Stage: UnreviewedAccepted

Changed 7 years ago by Claude Paroz

Attachment: 13336.patch added

Trivial patch to replace Pragma by Cache-Control

comment:2 Changed 7 years ago by Claude Paroz

Has patch: set

comment:3 Changed 7 years ago by anonymous

Triage Stage: AcceptedReady for checkin

comment:4 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [13129]) Fixed #13336 -- Corrected an incorrect example of cache header usage. Thanks to dnjuls for the report, and claudep for the patch.

comment:5 Changed 7 years ago by Russell Keith-Magee

(In [13132]) [1.1.X] Fixed #13336 -- Corrected an incorrect example of cache header usage. Thanks to dnjuls for the report, and claudep for the patch.

Backport of r13129 from trunk.

comment:6 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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