Prevent caching of content when wiki engine gets updated
authorBernie Innocenti <bernie@codewiz.org>
Sun, 16 May 2010 13:25:53 +0000 (09:25 -0400)
committerBernie Innocenti <bernie@codewiz.org>
Sun, 16 May 2010 13:25:53 +0000 (09:25 -0400)
geekigeeki.py

index 0427f9b3a4f40e538a256bede1ffb7cb4e7b47b5..788006001301cb9071f6322abb8807787de3f8f2 100755 (executable)
@@ -107,6 +107,8 @@ def url_args(kvargs):
 
 def emit_header(mtime=None, mime_type="text/html"):
     if mtime:
+        # Prevent caching when the wiki engine gets updated
+        mtime = max(mtime, os.stat(__file__).st_mtime)
         print("Last-Modified: " + strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime(mtime)))
     if mime_type:
         print("Content-type: " + mime_type + "; charset=utf-8")