magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.06k stars 683 forks source link

[bug]: Cached index.html at first load #4298

Open sm1thana opened 1 month ago

sm1thana commented 1 month ago

Describe the bug src/ServiceWorker/registerRoutes.js has rule for html files with NetworkFirst strategy: `/**

https://developer.chrome.com/docs/workbox/modules/workbox-strategies#network_first_network_falling_back_to_cache It should try to fetch the latest response from the network. So we should get the latest index.html if we are online.

To reproduce But if you will add some edits to venia's source code and open browser without reloading the page. You will see the old version. Browser will load new version only at the second loading. It happens because index.html loads from SW cache (old version) and new version loads from network a little bit later. You can see it at venia.magento.com: image

m2-assistant[bot] commented 1 month ago

Hi @sm1thana. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.