Cache busting in Ionic deployed as PWA


#1

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?


#2

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.


#3

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: https://medium.com/@zwacky/pwa-create-a-new-update-available-notification-using-service-workers-18be9168d717

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.


#4

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