diff --git a/pgcommitfest/commitfest/templates/base.html b/pgcommitfest/commitfest/templates/base.html index 4a6ba990..382c43bc 100644 --- a/pgcommitfest/commitfest/templates/base.html +++ b/pgcommitfest/commitfest/templates/base.html @@ -6,7 +6,7 @@ - + {%block extrahead%}{%endblock%} {%if rss_alternate%} {%endif%} @@ -43,6 +43,6 @@

{{title}}

- + {%block morescript%}{%endblock%} diff --git a/pgcommitfest/commitfest/templatetags/commitfest.py b/pgcommitfest/commitfest/templatetags/commitfest.py index c51765d2..08ec00c0 100644 --- a/pgcommitfest/commitfest/templatetags/commitfest.py +++ b/pgcommitfest/commitfest/templatetags/commitfest.py @@ -1,5 +1,6 @@ from django.template.defaultfilters import stringfilter from django import template +from uuid import uuid4 from pgcommitfest.commitfest.models import PatchOnCommitFest @@ -43,6 +44,18 @@ def alertmap(value): return 'alert-info' +# Generate a GET parameter that's unique per startup of the python process to +# bust the cache of the client, so that it pulls in possibly updated JS/CSS +# files. +STATIC_FILE_PARAM = f"v={uuid4()}" + + +# This GET parameter should be added to every one of our static files. +@register.simple_tag +def static_file_param(): + return STATIC_FILE_PARAM + + @register.filter(name='hidemail') @stringfilter def hidemail(value):