Skip to content
Discussion options

You must be logged in to vote

In your service worker file, you can do like follows -

const CACHE_NAME = "test1";

async function cacheCoreAssets() {
    const cache = await caches.open(CACHE_NAME);
    return cache.addAll([
        "/model.glb",
    ]);
}

self.addEventListener("install", (event) => {
    event.waitUntil(cacheCoreAssets());
    self.skipWaiting();
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rutger-codes
Comment options

Answer selected by rutger-codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants