From 87e3be44449e76c13dd6c7e1b3fad7c5cca60d93 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 2 Jun 2023 22:34:43 +0200 Subject: [PATCH] Added timestamp to ressources to avoid caching --- game.py | 5 ++++- templates/index.html | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/game.py b/game.py index 276b14d..7f7f1e0 100755 --- a/game.py +++ b/game.py @@ -66,6 +66,9 @@ def hello(): separator_char = config.get('main', 'separator_char') ablines = [] + now = datetime.now(tz=tz) + epoch = now.timestamp() + lines = getContent() for line in lines: ab = line.split(separator_char) @@ -76,7 +79,7 @@ def hello(): with open("ab.txt", "r") as f: num_lines = sum(1 for _ in f) - return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines) + return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines, epoch=epoch) def getContent(): lines = [a.strip() for a in open("ab.txt", "r").readlines()] diff --git a/templates/index.html b/templates/index.html index 1af6392..506ff32 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,7 +2,7 @@ {{ title }} - + @@ -30,7 +30,10 @@