Ticket #40 (closed task: fixed)
fileapp.py cache control condition inversed
| Reported by: | tsidwick AT gmail DOT com | Owned by: | ianb |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.1 |
| Component: | deploy | Version: | |
| Severity: | critical | Keywords: | cache HTTP_IF_MODIFIED_SINCE |
| Cc: | cce@… |
Description
A small bug in the DataApp? class I've just traced to do with the cacheing of static pages.
The server should return 200 if the client has never seen the page and 304 if the client has the most uptodate version.
in Paste/trunk/paste/fileapp.py the condition that decides this is
client_clock <= self.last_modified # if cache LESS RECENT or EQUAL to filesystem: return 304 # return "File not modified"
This is the wrong way around, it should read
client_clock >= self.last_modified # if cache MORE RECENT or EQUAL to filesystem return 304 # return "File not modified"
--- fileapp.py 2005-12-24 13:42:56.000000000 +0100
+++ fileapp.py~ 2005-12-24 12:14:29.000000000 +0100
@@ -178,6 +178,7 @@
"Please check your system clock.") % checkmod
).wsgi_application(environ, start_response)
elif client_clock >= self.last_modified:
+# elif client_clock <= self.last_modified:
# the client has a recent copy
start_response('304 Not Modified',[])
return [''] # empty body
Change History
Note: See
TracTickets for help on using
tickets.
