Hot Reload Static Files by Clearing Service Worker Cache while Developing

Share this video with your friends

Send Tweet

Once you register a Service Worker, the application will have the static files cached, making hard development since you’ll not see any changes. In addition, caching probably will happen on the server as well, making it even harder.

In this lesson you’ll understand how a service worker gets updated and learn how to continue developing, avoiding common pitfalls.

Szabolcs Nagy
~ 6 years ago

While developing Chrome can take care of updating your service worker if you check 'Update on reload' in Dev Tools > Application > Service Workers.

Alex Jover Moralesinstructor
~ 6 years ago

@szabolcsnagy true, but even if you check it the service worker and cache will still be applied and working. What you want when developing is to don't have any service worker or cache standing between you and your app. In the lesson after I explain an automated way to do it https://egghead.io/lessons/vue-js-use-a-no-op-service-worker-in-development, but there are others