From 1b8bd39026038a00f582573893f828578347068f Mon Sep 17 00:00:00 2001 From: zPlus Date: Fri, 1 Feb 2019 21:22:51 +0100 Subject: [PATCH] Fix #80 Vote caching problem --- freepost/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/freepost/__init__.py b/freepost/__init__.py index 9aeb8f82..aef00985 100755 --- a/freepost/__init__.py +++ b/freepost/__init__.py @@ -127,6 +127,12 @@ def homepage (): else: posts = [] + # Disable browser caching + # Fix issue: https://notabug.org/zPlus/freepost/issues/80 + response.set_header('cache-control', 'no-cache, no-store, must-revalidate') + response.set_header('pragma', 'no-cache') + response.set_header('expires', '0') + return template ('homepage.html', posts=posts, sort=sort) # TODO implement this @@ -501,6 +507,12 @@ def post_thread (hash_id): comments = children () + # Disable browser caching + # Fix issue: https://notabug.org/zPlus/freepost/issues/80 + response.set_header('cache-control', 'no-cache, no-store, must-revalidate') + response.set_header('pragma', 'no-cache') + response.set_header('expires', '0') + return template ( 'post.html', post=post,