summaryrefslogtreecommitdiff
path: root/paste/fileapp.py
diff options
context:
space:
mode:
authorcce <devnull@localhost>2007-01-10 15:38:44 +0000
committercce <devnull@localhost>2007-01-10 15:38:44 +0000
commit8575b7cae8b55ce98ad91b027f697718f5ce1c51 (patch)
treef1acd623fb5923386d23cba964971c2b3ebc40dd /paste/fileapp.py
parentfdd30923863d98eb3cde70b0ec4094a49cf56057 (diff)
downloadpaste-8575b7cae8b55ce98ad91b027f697718f5ce1c51.tar.gz
fixing server side cache /w the nocache header
Diffstat (limited to 'paste/fileapp.py')
-rw-r--r--paste/fileapp.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/paste/fileapp.py b/paste/fileapp.py
index a19a2e9..45d2e05 100644
--- a/paste/fileapp.py
+++ b/paste/fileapp.py
@@ -73,9 +73,12 @@ class DataApp(object):
self.expires = CACHE_CONTROL.apply(self.headers, **kwargs) or None
return self
- def set_content(self, content):
+ def set_content(self, content, last_modified=None):
assert content is not None
- self.last_modified = time.time()
+ if last_modified is None:
+ self.last_modified = time.time()
+ else:
+ self.last_modified = last_modified
self.content = content
self.content_length = len(content)
LAST_MODIFIED.update(self.headers, time=self.last_modified)
@@ -163,7 +166,7 @@ class FileApp(DataApp):
self.last_modified = stat.st_mtime
if stat.st_size < CACHE_SIZE:
fh = open(self.filename,"rb")
- self.set_content(fh.read())
+ self.set_content(fh.read(), stat.st_mtime)
fh.close()
else:
self.content = None