Invalidate CSS cache when updated
This commit is contained in:
parent
59688ad5f6
commit
ce80e98d33
3 changed files with 12 additions and 1 deletions
|
@ -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}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue