Versions
nuxt: 2.14.6
node: v15.9.0
What is Expected?
After upload every updates file to shared hosting inside dist folder. browser will load new version
What is actually happening?
'm using shared hosting to host the project. I'm using nuxt generate command compile it. After compile and upload every update it not effect need to reload the page. Assume my domain name like this http://example.com if i enter this in browser it load old version. But if I enter http://example.com/login it's load new version but not update the browser cache if I close tab and again load http://example.com its load old version. If I load http://example.com with old version and reload page it update the browser cache . Also I'm using nuxtjs pwa is there any chance to happen this issue using pwa?
This could be happening because the hosting provider is not correctly invalidating its cache when you deploy new versions of your site.
One way to solve this issue would be to include a cache-busting string in your file names when you build your Nuxt application. This will ensure that the hosting provider serves the updated version of your site, as the file names will be different from the ones in its cache.
To do this, you can modify the filenames property in your Nuxt configuration file (nuxt.config.js) like this:
export default { build: { filenames: { app: ({ isDev }) => isDev ? '[name].js' : '[name].[contenthash].js', chunk: ({ isDev }) => isDev ? '[name].js' : '[name].[contenthash].js', css: ({ isDev }) => isDev ? '[name].css' : '[name].[contenthash].css', img: ({ isDev }) => isDev ? '[path][name].[ext]' : 'img/[name].[hash:7].[ext]', font: ({ isDev }) => isDev ? '[path][name].[ext]' : 'font