mirror of
https://github.com/isledecomp/isle.pizza.git
synced 2026-01-11 10:41: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 = [
|
const coreAppFiles = [
|
||||||
'/', '/index.html', '/cancel_off.webp', '/cancel_on.webp', '/cdspin.gif',
|
'/', '/index.html', '/cancel_off.webp', '/cancel_on.webp', '/cdspin.gif',
|
||||||
'/configure_off.webp', '/configure_on.webp', '/favicon.png', '/favicon.svg',
|
'/configure_off.webp', '/configure_on.webp', '/favicon.png', '/favicon.svg',
|
||||||
'/free_stuff_off.webp', '/free_stuff_on.webp', '/install.mp4', '/install_off.webp',
|
'/free_stuff_off.webp', '/free_stuff_on.webp', '/install_off.webp', '/install_on.webp',
|
||||||
'/install_on.webp', '/install.webm', '/island.webp', '/isle.js', '/isle.wasm',
|
'/island.webp', '/isle.js', '/isle.wasm', '/poster.pdf', '/read_me_off.webp',
|
||||||
'/poster.pdf', '/read_me_off.webp', '/read_me_on.webp', '/run_game_off.webp',
|
'/read_me_on.webp', '/run_game_off.webp', '/run_game_on.webp', '/shark.webp',
|
||||||
'/run_game_on.webp', '/shark.webp', '/uninstall_off.webp', '/uninstall_on.webp',
|
'/uninstall_off.webp', '/uninstall_on.webp', 'app.js', 'style.css', 'manifest.json'
|
||||||
'app.js', 'style.css', 'manifest.json'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const gameFiles = [
|
const gameFiles = [
|
||||||
@ -36,10 +35,16 @@ const STATIC_CACHE_NAME = 'static-assets-v1';
|
|||||||
self.addEventListener('install', (event) => {
|
self.addEventListener('install', (event) => {
|
||||||
event.waitUntil(
|
event.waitUntil(
|
||||||
caches.open(STATIC_CACHE_NAME).then((cache) => {
|
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(
|
registerRoute(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user