Caching properly?
continuous-integration/drone/push Build is passing
Details
|
@ -1,12 +1,12 @@
|
||||||
<script>
|
<script>
|
||||||
let img = '/images/literallyme.jpg';
|
let img = '/assets/images/literallyme.jpg';
|
||||||
let clicked = false;
|
let clicked = false;
|
||||||
function cursify() {
|
function cursify() {
|
||||||
if (!clicked) {
|
if (!clicked) {
|
||||||
img = '/images/whydidyoudothis.png';
|
img = '/assets/images/whydidyoudothis.png';
|
||||||
clicked = true;
|
clicked = true;
|
||||||
} else {
|
} else {
|
||||||
img = '/images/literallyme.jpg';
|
img = '/assets/images/literallyme.jpg';
|
||||||
clicked = false;
|
clicked = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
}}
|
}}
|
||||||
class="w-full h-full min-w-max"
|
class="w-full h-full min-w-max"
|
||||||
>
|
>
|
||||||
<img src="/images/icons8-menu.svg" alt="Hamburger menu" />
|
<img src="/assets/images/icons8-menu.svg" alt="Hamburger menu" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<Menu bind:open />
|
<Menu bind:open />
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
setSong({
|
setSong({
|
||||||
musicTitle: 'MUUUSIC MAN!',
|
musicTitle: 'MUUUSIC MAN!',
|
||||||
musicArtist: 'MatPat',
|
musicArtist: 'MatPat',
|
||||||
musicUrl: '/music/MUUUSIC-MAN!.opus'
|
musicUrl: '/assets/music/MUUUSIC-MAN!.opus'
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
class="mt-3 hover:cursor-pointer underline max-w-full shadow-lg hover:shadow-xl w-max bg-indigo-100 p-2 rounded-md"
|
class="mt-3 hover:cursor-pointer underline max-w-full shadow-lg hover:shadow-xl w-max bg-indigo-100 p-2 rounded-md"
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<Musicplayer />
|
<Musicplayer />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex flex-col bg-gradient-to-tr from-[#A2D2FF] to-[#FFAFCC] w-screen text-murasaki overflow-auto min-h-screen relative "
|
class="flex flex-col bg-gradient-to-tr from-[#A2D2FF] to-[#FFAFCC] w-full text-murasaki overflow-auto min-h-screen relative "
|
||||||
>
|
>
|
||||||
<!-- Page content -->
|
<!-- Page content -->
|
||||||
<div class="" style="padding-bottom: {footerHeight + 10}px;">
|
<div class="" style="padding-bottom: {footerHeight + 10}px;">
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { build, files, version } from '$service-worker';
|
||||||
|
|
||||||
const worker = (self as unknown) as ServiceWorkerGlobalScope;
|
const worker = (self as unknown) as ServiceWorkerGlobalScope;
|
||||||
const STATIC_CACHE_NAME = `cache${version}`
|
const STATIC_CACHE_NAME = `cache${version}`
|
||||||
const APP_CACHE_NAME = `cache${version}`;
|
const APP_CACHE_NAME = `offline${version}`;
|
||||||
|
|
||||||
// Hardcoded bunch of routes to always preemptively cache
|
// Hardcoded bunch of routes to always preemptively cache
|
||||||
const routes = ["/", "/about"];
|
const routes = ["/", "/about"];
|
||||||
|
@ -92,6 +92,7 @@ worker.addEventListener("fetch", (event) => {
|
||||||
// Don't try to cache protocols other than http/https
|
// Don't try to cache protocols other than http/https
|
||||||
const isHttp = url.protocol.startsWith("http");
|
const isHttp = url.protocol.startsWith("http");
|
||||||
const isStaticAsset = staticAssets.has(url.href);
|
const isStaticAsset = staticAssets.has(url.href);
|
||||||
|
const isDev = url.host === self.location.host;
|
||||||
const skipBecauseUncached = event.request.cache === 'only-if-cached' && !isStaticAsset;
|
const skipBecauseUncached = event.request.cache === 'only-if-cached' && !isStaticAsset;
|
||||||
|
|
||||||
if (isHttp && !skipBecauseUncached) {
|
if (isHttp && !skipBecauseUncached) {
|
||||||
|
|
|
@ -3,43 +3,43 @@ import { readable } from "svelte/store";
|
||||||
const musicStore = readable([
|
const musicStore = readable([
|
||||||
{
|
{
|
||||||
musicTitle: "I'm glad you're evil too (feat. Hatsune Miku)",
|
musicTitle: "I'm glad you're evil too (feat. Hatsune Miku)",
|
||||||
musicUrl: "/music/im-glad-youre-evil-too.m4a",
|
musicUrl: "/assets/music/im-glad-youre-evil-too.m4a",
|
||||||
musicArtist: "PinocchioP",
|
musicArtist: "PinocchioP",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "God-ish (神っぽいな) feat. Hatsune Miku",
|
musicTitle: "God-ish (神っぽいな) feat. Hatsune Miku",
|
||||||
musicArtist: "PinocchioP",
|
musicArtist: "PinocchioP",
|
||||||
musicUrl: "/music/godish.m4a",
|
musicUrl: "/assets/music/godish.m4a",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "Servant of Evil (悪ノ召使) feat. Kagamine Len",
|
musicTitle: "Servant of Evil (悪ノ召使) feat. Kagamine Len",
|
||||||
musicArtist: "Mothy / Akuno-p",
|
musicArtist: "Mothy / Akuno-p",
|
||||||
musicUrl: "/music/servant-of-evil.m4a"
|
musicUrl: "/assets/music/servant-of-evil.m4a"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "Tokusya-Seizon Wonder-la-der!!",
|
musicTitle: "Tokusya-Seizon Wonder-la-der!!",
|
||||||
musicArtist: "Amane Kanata",
|
musicArtist: "Amane Kanata",
|
||||||
musicUrl: "/music/Tokusya-Seizon Wonder-la-der!!.mp3"
|
musicUrl: "/assets/music/Tokusya-Seizon Wonder-la-der!!.mp3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "Kegarenaki Barajuuji",
|
musicTitle: "Kegarenaki Barajuuji",
|
||||||
musicArtist: "Ariabl'eyeS",
|
musicArtist: "Ariabl'eyeS",
|
||||||
musicUrl: "/music/kegarenaki-barajuuji.mp3"
|
musicUrl: "/assets/music/kegarenaki-barajuuji.mp3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "-ERROR (Cover)",
|
musicTitle: "-ERROR (Cover)",
|
||||||
musicArtist: "Tokoyami Towa",
|
musicArtist: "Tokoyami Towa",
|
||||||
musicUrl: "/music/error-towa.mp3"
|
musicUrl: "/assets/music/error-towa.mp3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "Diamond City Lights",
|
musicTitle: "Diamond City Lights",
|
||||||
musicArtist: "LazuLight",
|
musicArtist: "LazuLight",
|
||||||
musicUrl: "/music/diamond-city-lights-lazulight.opus"
|
musicUrl: "/assets/music/diamond-city-lights-lazulight.opus"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
musicTitle: "TSUNAMI",
|
musicTitle: "TSUNAMI",
|
||||||
musicArtist: "Finana Ryugu",
|
musicArtist: "Finana Ryugu",
|
||||||
musicUrl: "/music/tsunami-finana.opus"
|
musicUrl: "/assets/music/tsunami-finana.opus"
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 173 B After Width: | Height: | Size: 173 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
Before Width: | Height: | Size: 624 KiB After Width: | Height: | Size: 624 KiB |
Before Width: | Height: | Size: 453 KiB After Width: | Height: | Size: 453 KiB |
|
@ -10,11 +10,6 @@ const config = {
|
||||||
],
|
],
|
||||||
kit: {
|
kit: {
|
||||||
adapter: adapter(),
|
adapter: adapter(),
|
||||||
serviceWorker: {
|
|
||||||
files: (filePath) => {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|