nuxt icon indicating copy to clipboard operation
nuxt copied to clipboard

AutoUpdate - does not reload page automatically

Open crunchwrap89 opened this issue 1 year ago • 1 comments

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
    }
  },

crunchwrap89 avatar May 15 '23 20:05 crunchwrap89

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,

userquin avatar May 15 '23 20:05 userquin