Pwa-module: use network-first strategy for start_url

Created on 30 Nov 2020  路  2Comments  路  Source: nuxt-community/pwa-module

Since Lighthouse made it mandatory to respond to start_url when offline, we are pre-caching it (3.2.1). A build-time revision added by 3.3.0 / #386 but since revision is per-build, cached version for start_url may get stalled with target: 'server' since workbox does not supports NetworkFirst strategy for precache assets.

This is a known issue for users that use target: 'server':

  • If start_url is not customized or is distinct it might cache ATH version until next build
  • If start_url is customized to /, it might caching landing until next build
bug

Most helpful comment

any news regarding this issue? every time we do a new deploy the start_url gets stalled and then we get a lot of loading chunk errors because it tries to access files that do not exist anymore on the server

All 2 comments

any news regarding this issue? every time we do a new deploy the start_url gets stalled and then we get a lot of loading chunk errors because it tries to access files that do not exist anymore on the server

Yeah, we're having this problem too, it seems there's still some nuxt hydration going on on page load, but no new data is being loaded from fetch() etc. so we're getting stale data on the homepage until the next deployment. The default ?standalone=true just moves the issue to that route instead, in that case anyone who has installed it as a PWA will get a stale homepage most of the time.

Was this page helpful?
0 / 5 - 0 ratings