The Modern PWA uses web caching for certain resources like images and styles. When testing the Modern PWA with the Run PWA
button in the toolbar, SAB builds the PWA and then starts a development web server to run it. The web server runs on localhost at port 4173.
If you test multiple Modern PWAs, the resources from the previous run will be used. When you start a new Modern PWA, you will need to clear the cache for that host and port. I have not figured out how to do that programmatically from SAB (I would love to know). Here is how you can do this if you are using the Chrome browser.
Clear application data
- right-click on the browser and select “Inspect”
- select the Application tab at the top of the DevTools windows
- select the Storage entry under the Application category at the top
- click the Clear site data button at the right
- refresh the browser page
Clear Site Data extension
- Install the Clear Site Data extension on the chrome web store. You can pin the extension to your toolbar.
- when you have browse to the Modern PWA, run the Clear Site Data extension and clear the site data for the current website
- refresh the browser page