lighthouse fixes

This commit is contained in:
2026-02-10 22:37:29 -05:00
parent 26a8c97841
commit 07d8787972
785 changed files with 166486 additions and 77 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,5 +1,4 @@
User-agent: *
Allow: /
Sitemap: /sitemap-index.xml
Sitemap: https://santhoshj.com/sitemap-index.xml

File diff suppressed because it is too large Load Diff

View File

@@ -21,9 +21,7 @@ const CACHE_SHELL = `shell-${CACHE_VERSION}`;
const CACHE_PAGES = `pages-${CACHE_VERSION}`;
const CACHE_MEDIA = `media-${CACHE_VERSION}`;
const assetSuffix = cacheVersionFromUrl ? `?v=${encodeURIComponent(cacheVersionFromUrl)}` : "";
const SHELL_ASSETS = ["/", `/styles/global.css${assetSuffix}`, "/favicon.png", "/robots.txt"];
const SHELL_ASSETS = ["/", "/favicon.png", "/robots.txt"];
// Cache.addAll() throws if there are any duplicate requests.
const SHELL_ASSETS_UNIQUE = Array.from(new Set(SHELL_ASSETS));
@@ -138,25 +136,6 @@ self.addEventListener("fetch", (event) => {
return;
}
// Network-first for global CSS to avoid serving stale styling after deploy.
// (The SW already caches styles, but network-first prevents a "stuck" old CSS experience.)
if (url.origin === self.location.origin && url.pathname === "/styles/global.css") {
event.respondWith(
(async () => {
try {
const fresh = await fetch(request);
await cachePutSafe(CACHE_SHELL, request, fresh.clone());
return fresh;
} catch {
const cached = await caches.match(request);
if (cached) return cached;
return fetch(request);
}
})(),
);
return;
}
// Stale-while-revalidate for styles/scripts/fonts from same-origin.
if (
url.origin === self.location.origin &&