mirror of
https://github.com/shadoll/sLogos.git
synced 2026-02-04 02:53:22 +00:00
feat: Update asset paths and add emblems collection for PWA caching
This commit is contained in:
8
public/data/emblems.json
Normal file
8
public/data/emblems.json
Normal file
@@ -0,0 +1,8 @@
|
||||
[
|
||||
{
|
||||
"name": "Escudo De España",
|
||||
"path": "images/emblems/Escudo_de_España.svg",
|
||||
"format": "SVG",
|
||||
"disable": false
|
||||
}
|
||||
]
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user