When you install a service worker, what it's essentially doing is grabbing that java script and saving it into your browser or your local cash. So once the service worker is running, every single time that you visit a web site, that service worker is going to immediately run. And if you have things like net workndeception in there, that's where you're allowed to serve up a local version because the person is off line. If you register a service worker and you say, serve up this cash, and you don't give it any instructions to kill itself, then that cash will always be served up everysingle time thatyou visit the web sit.
In this episode of Syntax, Wes and Scott talk through the fundamentals of web workers and service workers - examples, when you should use them, how to debug, local dev, and more.
LogRocket - Sponsor
LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.
Sanity - Sponsor
Sanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.
Freshbooks - Sponsor
Get a 30 day free trial of Freshbooks at freshbooks.com/syntax
Show Notes
××× SIIIIICK ××× PIIIICKS ×××
Shameless Plugs
Tweet us your tasty treats