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:
parent
6f3b995455
commit
a35697e55e
44 changed files with 203 additions and 191 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue