Opened 5 years ago

Closed 5 years ago

Last modified 3 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 claudep 5 years ago.
Trivial patch to replace Pragma by Cache-Control

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by russellm

  • milestone set to 1.2
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 5 years ago by claudep

Trivial patch to replace Pragma by Cache-Control

comment:2 Changed 5 years ago by claudep

  • Has patch set

comment:3 Changed 5 years ago by anonymous

  • Triage Stage changed from Accepted to Ready for checkin

comment:4 Changed 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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 5 years ago by russellm

(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 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

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