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

@ -6,6 +6,7 @@ from files.classes.views import ViewerRelationship
from files.helpers.alerts import *
from files.helpers.sanitize import *
from files.helpers.const import *
from files.helpers.assetcache import assetcache_path
from files.mail import *
from flask import *
from files.__main__ import app, limiter, db_session
@ -26,7 +27,7 @@ def pusher_thread2(interests, notifbody, username):
'title': f'New message from @{username}',
'body': notifbody,
'deep_link': f'{SITE_FULL}/notifications?messages=true',
'icon': f'{SITE_FULL}/assets/images/{SITE_ID}/icon.webp?v=1015',
'icon': SITE_FULL + assetcache_path(f'images/{SITE_ID}/icon.webp'),
}
},
'fcm': {
@ -704,7 +705,7 @@ def messagereply(v):
'title': f'New message from @{v.username}',
'body': notifbody,
'deep_link': f'{SITE_FULL}/notifications?messages=true',
'icon': f'{SITE_FULL}/assets/images/{SITE_ID}/icon.webp"a=1010',
'icon': SITE_FULL + assetcache_path(f'images/{SITE_ID}/icon.webp'),
}
},
'fcm': {