Ticket #40 (closed task: fixed)

Opened 6 years ago

Last modified 3 years ago

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

Changed 6 years ago by ianb

  • cc cce@… added

Changed 6 years ago by cce

  • status changed from new to closed
  • resolution set to fixed

Thank you for reporting; this has been fixed in the trunk with the change you suggested.

Changed 6 years ago by anonymous

  • severity changed from normal to critical
  • component changed from *paste to deploy
  • priority changed from high to normal
  • version svn-trunk deleted
  • milestone set to 0.9
  • type changed from defect to task

Changed 6 years ago by anonymous

Great resource. Really helpful for understand odbc things.

Thanks.

my email:googlefans@163.com

=============Some my site====================

1. wow gold

2. world of warcraft gold

3. wow gold

Changed 5 years ago by anonymous

  • milestone 0.9 deleted

Milestone 0.9 deleted

Note: See TracTickets for help on using tickets.