nuxt
nuxt copied to clipboard
AutoUpdate - does not reload page automatically
I have a nuxt 3 app that i would like to get automatically updated when new version is available.
When i do following:
- Deploy new version to Vercel.
- 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
}
},
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,