Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #728 (defect)

Opened 11 months ago

Last modified 9 months ago

tools.expires doesn't set a past-date header when secs=0

Status: closed (fixed)

Reported by: hax Assigned to: rdelon
Priority: normal Milestone: 3.1
Component: CherryPy code Keywords:
Cc:

Because we are using @cherrypy.tools.expires(secs=0) as the way of saying "this page should never be cached", the "Expires" header should be sent with a past date.

At the end of lib/expires.py def tools(), we can fix this by adding:

if secs == 0:
    headers["Expires"] = http.HTTPDate(response.time - 31556926)

This sets the "Expires" header back in time a year when secs=0, which is just arbitrarily chosen, but there are no guidelines for how far back to set the date. Another approach would be to just always set the header to sometime in the 90s.

Change History

10/27/07 23:15:03: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 3.1.

Fixed in [1790].

Hosted by WebFaction

Log in as guest/cpguest to create tickets