Changeset 1207
- Timestamp:
- 07/24/06 22:10:26
- Files:
-
- trunk/cherrypy/lib/caching.py (modified) (2 diffs)
- trunk/cherrypy/test/test_caching.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/caching.py
r1203 r1207 186 186 secs = (86400 * secs.days) + secs.seconds 187 187 expiry = http.HTTPDate(cherrypy.response.time + secs) 188 cptools.response_headers([("Expires", expiry)], force)189 188 190 189 if secs == 0: … … 200 199 if cherrypy.request.version >= (1, 1): 201 200 cptools.response_headers([("Cache-Control", "no-cache")], force) 201 202 # Set after Pragma, Cache-Control so it doesn't interfere with 'indicators' 203 cptools.response_headers([("Expires", expiry)], force) trunk/cherrypy/test/test_caching.py
r1203 r1207 123 123 self.getPage("/expires/force") 124 124 self.assertStatus("200 OK") 125 # This also gives us a chance to test 0 expiry with no other headers 126 self.assertHeader("Pragma", "no-cache") 127 self.assertHeader("Cache-Control", "no-cache") 128 d = self.assertHeader("Date") 129 self.assertHeader("Expires", d) 125 130 126 131 # static content should now have "cache prevention" headers

