Cache busting in Ionic deployed as PWA

I’m wondering what methods are currently being used to handle cache busting for apps that use the lazy-loading @IonicPage decorators for apps that are deployed on the web.

Using standard workarounds like appending v?=x.y.z to the script path on index.html don’t work so great, as the browser only pulls down a fresh instance of main.js and not any of the sub-modules 1.main.js, 2.main.js` etc.

Is there a recommended approach for this?

1 Like

Questions like this are in a major state of flux right now, because the devs are doing a major retool of the browser. Maybe the problem will still exist in three months, maybe you’ll have a different problem instead! But I think right now, your best options are to open an issue on GitHub, or wait and see what happens.

1 Like

True, I was just wondering what people are resorting to at this point in time.

I’ve implemented something similar to what has been outlined here:

With some modifications, including loading a bundled json file which contains instructions about various localstorage migration methods to run, or not run, after an update to the cache version.

I am using lazy load module. Really hope ionic team can provide this feature.