feat: Update asset paths and add emblems collection for PWA caching

This commit is contained in:
sHa
2025-06-18 12:27:34 +03:00
parent 708334bcf4
commit 06ecfbf377
7 changed files with 74 additions and 179 deletions

8
public/data/emblems.json Normal file
View File

@@ -0,0 +1,8 @@
[
{
"name": "Escudo De España",
"path": "images/emblems/Escudo_de_España.svg",
"format": "SVG",
"disable": false
}
]

View File

@@ -34,8 +34,8 @@ self.addEventListener('fetch', event => {
const url = new URL(event.request.url);
// Remove query params for cache matching for static files
let cacheKey = url.pathname;
// Only do this for files we know are static (e.g., /data/, /logos/, /logos_gen/, /public/)
if (cacheKey.startsWith('/data/') || cacheKey.startsWith('/logos/') || cacheKey.startsWith('/logos_gen/')) {
// Only do this for files we know are static (e.g., /data/, /images/)
if (cacheKey.startsWith('/data/') || cacheKey.startsWith('/images/')) {
// ignore query params
} else {
cacheKey = event.request.url;