From 7fa5a939d0964270456602774d82cf4a8577fe86 Mon Sep 17 00:00:00 2001 From: Michael Reber Date: Tue, 16 Dec 2025 22:38:18 +0100 Subject: [PATCH] Added timestamp-based cache busting by passing a version value from IndexHandler and appending it as ?v=.version to local CSS and JS includes. --- pkg/web/handlers.go | 1 + pkg/web/templates/index.html | 40 ++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/pkg/web/handlers.go b/pkg/web/handlers.go index c55c6ba..2ebc970 100644 --- a/pkg/web/handlers.go +++ b/pkg/web/handlers.go @@ -1074,6 +1074,7 @@ func shouldAlertForCountry(country string, alertCountries []string) bool { func IndexHandler(c *gin.Context) { c.HTML(http.StatusOK, "index.html", gin.H{ "timestamp": time.Now().Format(time.RFC1123), + "version": time.Now().Unix(), }) } diff --git a/pkg/web/templates/index.html b/pkg/web/templates/index.html index 622983b..9a58f37 100644 --- a/pkg/web/templates/index.html +++ b/pkg/web/templates/index.html @@ -27,7 +27,7 @@ - - + - + @@ -1208,22 +1208,22 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +