From d067e17cbd00e8c815130d853279eeed7dcc38fd Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Wed, 20 Nov 2019 20:26:34 -0800 Subject: [PATCH] Add cachebuster to embedjs --- webapp/titanembeds/app.py | 6 +++++- webapp/titanembeds/templates/embed.html.j2 | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/titanembeds/app.py b/webapp/titanembeds/app.py index 6308f81..257af89 100644 --- a/webapp/titanembeds/app.py +++ b/webapp/titanembeds/app.py @@ -22,6 +22,9 @@ import titanembeds.constants as constants from datetime import timedelta import datetime import random +import time + +app_start_stamp = time.time() os.chdir(config['app-location']) app = Flask(__name__, static_folder="static") @@ -97,7 +100,8 @@ def context_processor(): "sentry_js_dsn": config.get("sentry-js-dsn", None), "constants": constants, "af_mode_enabled": datetime.datetime.now().date() == datetime.date(datetime.datetime.now().year, 4, 1), - "dbl_voted": session.get("unauthenticated", True) == False and bool(redis_store.get("DiscordBotsOrgVoted/" + str(session.get("user_id", -1)))) + "dbl_voted": session.get("unauthenticated", True) == False and bool(redis_store.get("DiscordBotsOrgVoted/" + str(session.get("user_id", -1)))), + "app_start_stamp": app_start_stamp } # @app.errorhandler(500) diff --git a/webapp/titanembeds/templates/embed.html.j2 b/webapp/titanembeds/templates/embed.html.j2 index 71fa5da..2256b19 100644 --- a/webapp/titanembeds/templates/embed.html.j2 +++ b/webapp/titanembeds/templates/embed.html.j2 @@ -634,7 +634,7 @@ const cookie_test_s2_URL = {{ url_for("embed.cookietest2", _external=True)|tojson|safe }}; - + {% if af_mode_enabled %}