fix: use data-preload='false' and revert SW strategy to resolve browser warnings
Some checks failed
Build MIPS Binary / build (push) Failing after 44s

This commit is contained in:
spinline
2026-02-12 23:23:40 +03:00
parent ed5fba4b46
commit c1306a32a9
2 changed files with 2 additions and 20 deletions

View File

@@ -20,7 +20,7 @@
<link rel="apple-touch-icon" sizes="512x512" href="icon-512.png" />
<!-- Trunk Assets -->
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="0" data-no-preload />
<link data-trunk rel="rust" href="Cargo.toml" data-wasm-opt="0" data-preload="false" />
<link data-trunk rel="css" href="public/tailwind.css" />
<link data-trunk rel="copy-file" href="manifest.json" />
<link data-trunk rel="copy-file" href="icon-192.png" />

View File

@@ -88,25 +88,7 @@ self.addEventListener("fetch", (event) => {
return;
}
// Special strategy for WASM and Main JS to prevent Preload warnings
if (url.pathname.endsWith(".wasm") || (url.pathname.endsWith(".js") && url.pathname.includes("frontend-"))) {
event.respondWith(
fetch(event.request)
.then((response) => {
const responseToCache = response.clone();
caches.open(CACHE_NAME).then((cache) => {
cache.put(event.request, responseToCache);
});
return response;
})
.catch(() => {
return caches.match(event.request);
}),
);
return;
}
// Cache-first strategy for other static assets (CSS, Images, etc.)
// Cache-first strategy for static assets (JS, CSS, Images)
event.respondWith(
caches.match(event.request).then((response) => {
return (