Fix for video cache

This commit is contained in:
Christian Semmler 2025-07-17 19:17:09 -07:00
parent 3b76e96113
commit a9f3940e22
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
2 changed files with 12 additions and 7 deletions

Binary file not shown.

19
sw.js
View File

@ -12,11 +12,10 @@ const { RangeRequestsPlugin } = workbox.rangeRequests;
const coreAppFiles = [
'/', '/index.html', '/cancel_off.webp', '/cancel_on.webp', '/cdspin.gif',
'/configure_off.webp', '/configure_on.webp', '/favicon.png', '/favicon.svg',
'/free_stuff_off.webp', '/free_stuff_on.webp', '/install.mp4', '/install_off.webp',
'/install_on.webp', '/install.webm', '/island.webp', '/isle.js', '/isle.wasm',
'/poster.pdf', '/read_me_off.webp', '/read_me_on.webp', '/run_game_off.webp',
'/run_game_on.webp', '/shark.webp', '/uninstall_off.webp', '/uninstall_on.webp',
'app.js', 'style.css', 'manifest.json'
'/free_stuff_off.webp', '/free_stuff_on.webp', '/install_off.webp', '/install_on.webp',
'/island.webp', '/isle.js', '/isle.wasm', '/poster.pdf', '/read_me_off.webp',
'/read_me_on.webp', '/run_game_off.webp', '/run_game_on.webp', '/shark.webp',
'/uninstall_off.webp', '/uninstall_on.webp', 'app.js', 'style.css', 'manifest.json'
];
const gameFiles = [
@ -36,10 +35,16 @@ const STATIC_CACHE_NAME = 'static-assets-v1';
self.addEventListener('install', (event) => {
event.waitUntil(
caches.open(STATIC_CACHE_NAME).then((cache) => {
return cache.addAll(coreAppFiles);
return cache.addAll(coreAppFiles).then(() => {
return fetch('/install.mp4', { cache: 'reload' }).then((response) => {
if (!response.ok) {
throw new Error('Video fetch failed!');
}
return cache.put('/install.mp4', response);
});
});
})
);
self.skipWaiting();
});
registerRoute(