mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2025-06-05 21:59:23 +02:00
Invalidate CSS cache when updated
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import hashlib
|
||||
import os
|
||||
import secrets
|
||||
from pathlib import Path
|
||||
@ -25,6 +26,14 @@ try:
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Force reloading cache when the CSS is updated
|
||||
CSS_HASH = "none"
|
||||
try:
|
||||
css_data = (ROOT_DIR / "app" / "static" / "css" / "main.css").read_bytes()
|
||||
CSS_HASH = hashlib.md5(css_data, usedforsecurity=False).hexdigest()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
||||
VERSION = f"2.0.0+{VERSION_COMMIT}"
|
||||
USER_AGENT = f"microblogpub/{VERSION}"
|
||||
|
Reference in New Issue
Block a user