Opened 14 years ago

Closed 14 years ago

Last modified 13 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: dev
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: no UI/UX: no

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 14 years ago.
Trivial patch to replace Pragma by Cache-Control

Download all attachments as: .zip

Change History (7)

comment:1 by Russell Keith-Magee, 14 years ago

milestone: 1.2
Triage Stage: UnreviewedAccepted

by Claude Paroz, 14 years ago

Attachment: 13336.patch added

Trivial patch to replace Pragma by Cache-Control

comment:2 by Claude Paroz, 14 years ago

Has patch: set

comment:3 by anonymous, 14 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Russell Keith-Magee, 14 years ago

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 by Russell Keith-Magee, 14 years ago

(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 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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