From a4def29f92f1c5743da5d7bf86b4214579bf385d Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Fri, 14 Oct 2011 21:07:46 -0400 Subject: [PATCH] Do not allow caching generated pages, such as the page editor --- geekigeeki.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/geekigeeki.py b/geekigeeki.py index 7700585..2dbf03b 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -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 \[\[[^\]]+\]\]) # Inline HTML - | (?P <(br|hr|div|span|form|iframe|input|textarea|a|img|h[1-5])\b ) - | (?P ( /\s*> | ) ) + | (?P <(br|hr|small|div|span|form|iframe|input|textarea|a|img|h[1-5])\b ) + | (?P ( /\s*> | ) ) | (?P [<>&] ) # 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('\n') print("%s: %s" % (config_get('site_name', "Unconfigured Wiki"), text)) print(' ') -- 2.25.1