In the Chrome DevTools tab I can see that from time to time the client tries to load http://localhost:8080/sw.js which fails with 404.

In my setup the tomcat is behind an apache server which forwards to the tomcat. From outside the correct url would be http://myserver/sw.js. Why is the client trying to load sw.js with the internal url.

How can I fix this?


sw.js sounds like a service worker some app has registered. Check the Application tab in dev tools

I checked the service tab:

Is sw.js expected to be available at the root path?

Well at some point it probably has been and some code has asked it to be registered. If you are not using a service worker, the quick fix would be to delete it in dev tools/applications and see if it reappears

For instance Bakery uses a service worker to cache resources and provide an offline page.

I deleted it and on two machines it didn’t reappear. On one it got installed again. My app is based on the beverage buddy demo.

Is there a service worker used? How can I check where this service worker is coming from?