DEV Community

samirindiaittech
samirindiaittech

Posted on

Issue regarding hosted React Application on IIS

Hello,

I have hosted my React Application on IIS, but facing problem after second release if end users had already opened browser, service worker doesn't take's new component without refreshing the page,

Any solution or workaround will be highly appreciated?

Thank you in advance,
Samir Sanghvi

Top comments (1)

Collapse
 
jamesoyanna profile image
James Oyanna

Heey Samir, happy to help.
What could be happening is that your service worker is caching the resources, and when a new release happens, the old cached version still stick around in your browser.

What you can do is to change the name of your service worker file or its version whenever you release a new version.
This would force the browser to fetch the new service worker.