Add a mechanism for cache-busting static files

This commit is contained in:
andrew committed 2024-03-07 19:15:41 -05:00
1 parent 5692a1373a
commit eca8ccc613
7 files changed
+16 -12

No files matched your search

+2
View File
@@ -25,6 +25,8 @@ import traceback
from OpenSite.settings import PROJECT_PATH
OPENBENCH_STATIC_VERSION = 'v1'
OPENBENCH_CONFIG = None # Initialized by OpenBench/apps.py
def create_openbench_config():
+2 -1
View File
@@ -33,7 +33,7 @@ from OpenBench.workloads.modify_workload import modify_workload
from OpenBench.workloads.verify_workload import verify_workload
from OpenBench.workloads.view_workload import view_workload
from OpenBench.config import OPENBENCH_CONFIG
from OpenBench.config import OPENBENCH_CONFIG, OPENBENCH_STATIC_VERSION
from OpenSite.settings import PROJECT_PATH
from OpenBench.models import *
@@ -68,6 +68,7 @@ def render(request, template, content={}, always_allow=False, error=None, warnin
data = content.copy()
data.update({ 'config' : OPENBENCH_CONFIG })
data.update({ 'static_version' : OPENBENCH_STATIC_VERSION })
if OPENBENCH_CONFIG['require_login_to_view']:
if not request.user.is_authenticated and not always_allow: