mirror of
https://github.com/isledecomp/isle.pizza.git
synced 2026-01-10 18:21:15 +00:00
Fix for video cache
This commit is contained in:
parent
3b76e96113
commit
a9f3940e22
BIN
install.webm
BIN
install.webm
Binary file not shown.
19
sw.js
19
sw.js
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user