Skip to content

Service worker is not picking new build JS/CSS files #38

@rsoni5519

Description

@rsoni5519

This issue is not related with ur repo but it will will be helpful if u can help me here.
I created one react app with CRA and integrated service worker to cache mainly JS and CSS files. When I ran the build for 2nd time and reload my page. It's still loading the 1st build JS files (It should load the 2nd JS files from server and then should load from the cache in subsequent loads).

When I manually empty the cache and hard reload option then this time New js files load from the network and subsequent loads the correct JS files.

How can we resolve this as I am going to use this code in app where my code will run in the browser. I don't want to provide some WA like giving a button to the user to hard reload.

Is workbox providing some solution to this? Please check below code. https://github.com/rsoni5519/sw-app
service worker issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions