fix: Add Cache-Control: no-cache to static files to prevent stale HTML/image caching
This commit is contained in:
@@ -2417,4 +2417,10 @@ def list_all_service_entrances():
|
||||
app.mount("/uploads", StaticFiles(directory=str(UPLOADS_DIR)), name="uploads")
|
||||
|
||||
if STATIC_DIR.exists():
|
||||
app.mount("/", StaticFiles(directory=str(STATIC_DIR), html=True), name="static")
|
||||
class NoCacheStaticFiles(StaticFiles):
|
||||
async def get_response(self, path, scope):
|
||||
resp = await super().get_response(path, scope)
|
||||
# No-cache for all static assets (HTML, images, JS, CSS)
|
||||
resp.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
|
||||
return resp
|
||||
app.mount("/", NoCacheStaticFiles(directory=str(STATIC_DIR), html=True), name="static")
|
||||
|
||||
+1
-1
@@ -3126,7 +3126,7 @@
|
||||
// ── Category config ───────────────────────────────────────────────────
|
||||
const CATEGORY_MAP = {
|
||||
'Bev': { icon: '🥤', color: '#0a7ab5' },
|
||||
'Snack': { icon: '<img src="icons/chips.png" class="cat-icon-img" alt="">', color: '#c97d0e' },
|
||||
'Snack': { icon: '<img src="icons/chips.png?v=2" class="cat-icon-img" alt="">', color: '#c97d0e' },
|
||||
'Gf bev': { icon: '🧃', color: '#0a9e5a' },
|
||||
'Gf food': { icon: '🥪', color: '#8a5c2a' },
|
||||
'Other': { icon: '📦', color: '#6b7280' },
|
||||
|
||||
Reference in New Issue
Block a user