Replace nearly all ?v= cachebusts with assetcache.

Using the new assetcache module, we replace (almost) all instances
of `?v=` cachebusting query parameters in Python and in Jinja templates.
The primary exceptions were: user site backgrounds, and some
infrequently changed graphics referenced literally from .js files.
This commit is contained in:
TLSM 2022-08-30 17:02:46 -04:00
parent 6f3b995455
commit a35697e55e
No known key found for this signature in database
GPG key ID: E745A82778055C7E
44 changed files with 203 additions and 191 deletions

View file

@ -4,6 +4,7 @@ from files.__main__ import Base, app
from os import environ
from files.helpers.lazy import lazy
from files.helpers.const import *
from files.helpers.assetcache import assetcache_path
from datetime import datetime
from json import loads
@ -61,7 +62,7 @@ class Badge(Base):
@property
@lazy
def path(self):
return f"/assets/images/badges/{self.badge_id}.webp"
return assetcache_path(f'images/badges/{self.badge_id}.webp')
@property
@lazy