Do not allow caching generated pages, such as the page editor
authorBernie Innocenti <bernie@codewiz.org>
Sat, 15 Oct 2011 01:07:46 +0000 (21:07 -0400)
committerBernie Innocenti <bernie@codewiz.org>
Sat, 15 Oct 2011 01:07:46 +0000 (21:07 -0400)
geekigeeki.py

index 7700585b975aefeda856cefd643d4276f66cb1d0..2dbf03b82674125d32d0ddedbdcb9e58224c2cf7 100755 (executable)
@@ -110,8 +110,9 @@ def emit_header(mtime=None, mime_type="text/html"):
         # 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")
+    else:
+        print("Cache-Control: must-revalidate, max-age=0")
+    print("Content-type: " + mime_type + "; charset=utf-8")
     print('')
 
 def send_guru(msg_text, msg_type):
@@ -474,8 +475,8 @@ class WikiFormatter:
             | (?P<hurl>  \[\[[^\]]+\]\])
 
             # Inline HTML
-            | (?P<html>             <(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])\b )
-            | (?P<htmle> ( /\s*> | </(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])> ) )
+            | (?P<html>             <(br|hr|small|div|span|form|iframe|input|textarea|a|img|h[1-5])\b )
+            | (?P<htmle> ( /\s*> | </(br|hr|small|div|span|form|iframe|input|textarea|a|img|h[1-5])> ) )
             | (?P<ent>   [<>&] )
 
             # Auto links (LEGACY)
@@ -646,7 +647,7 @@ class Page:
         if title_done: return
 
         # HEAD
-        emit_header(self._mtime())
+        emit_header(name and self._mtime())
         print('<!doctype html>\n<html lang="en">')
         print("<head><title>%s: %s</title>" % (config_get('site_name', "Unconfigured Wiki"), text))
         print(' <meta charset="UTF-8">')