vite-pwa / nuxt

Zero-config PWA Plugin for Nuxt 3
https://vite-pwa-org.netlify.app/frameworks/nuxt
MIT License
453 stars 22 forks source link

AutoUpdate - does not reload page automatically #41

Open crunchwrap89 opened 1 year ago

crunchwrap89 commented 1 year ago

I have a nuxt 3 app that i would like to get automatically updated when new version is available.

When i do following:

  1. Deploy new version to Vercel.
  2. Open the app via https://geoquester.com.

The following happens: The old version is downloaded.

If i refresh the page with F5 then the new version is downloaded and shown, but only if the pwa was fast enough to download it before hitting F5.

Do i need to do any specific setup for this to work=?

This is my current config:

  pwa: {
    registerType: 'autoUpdate',
    manifest: {
      name: 'GeoQuestr',
      short_name: 'GeoQuestr',
      theme_color: '#0a1a1f',
      description: 'Build and play location based games.',
      background_color: '#0a1a1f',
      icons: icons.icons
    },
    workbox: {
      navigateFallback: '/',
      globPatterns: ['**/*.{js,css,html,ico,png,svg,gltf,bin}'],
      maximumFileSizeToCacheInBytes: 25097152
    }
  },
userquin commented 1 year ago

Check your cache headers: https://vite-pwa-org.netlify.app/deployment/

Then you can use configure periodicSyncForUpdates: for context https://vite-pwa-org.netlify.app/guide/periodic-sw-updates.html,