Lets go explore a service worker. I walk through the example given from SvelteKit on Service Workers. To implement this we create a service-worker.js file and then add 3 separate steps. Step one installs the service woker. Step 2 activates the service worker and deletes any old caches and finally in step 3 we add a function that will watch for GET requests and if they are responded to successfully it will add the response to our cache and if it fails it will return the cached file. I hope you find this helpful!
My channel membership is live check it out here!:
/ @consultingninja
Membership perk video:
• I launched a chatbot with my channel membe...
Need help? visit https://www.consultingninja.tech
Check out my channel @ConsultingNinja for more videos like these.
GoogleChrome Service Worker Doc:
https://googlechrome.github.io/sample...
SvelteKit Service Worker Docs:
https://kit.svelte.dev/docs/service-w...
SvelteKit Sandbox:
https://learn.svelte.dev/tutorial/wel...