0

With Nuxt Vue.js releases, the names of the set of js-files change, making the accumulated Varnish cache irrelevant. This causes the Varnish cache to start rebuilding after each release.

Is there a way not to use the accumulated Varnish cache on Nuxt Vue.js releases?

1 Answer 1

1

When you deploy a new release of your software, I find it quite important to have the cache invalidated. The fact that a new file name is generated for the JS files for new Nuxt Vue.js releases, seems like a good thing to me and takes away the need to invalidate the cache manually.

If the filenames remain the same, you have to purge the impacted JS files from the cache for the updates to be pulled in by the end-user's browser.

The fact that you have a cache miss after a new release seems like a non-issue to me: Varnish only has to fetch the updated JS files once and they're back in the cache. It doesn't look like the performance penalty will be that big.

And if you want to minimize the impact even further, just pre-fetch the updated JS files as part of your post-deployment logic. That way you're sure the users are going to hit the cache upon the next visit.

I fail to understand the real issue here. So if I'm missing the point, please elaborate why this is such an inconvenience to you.

2
  • My problem: the site has many pages. After deployment, every first visit to the page will not receive data from the cache, and this will greatly degrade core web vitals for 1-2 weeks. But in 2 weeks it's release time again :) Commented Jul 6 at 12:15
  • 1
    @SartakovDmytro My advice would be to develop a cache rebuild script based on the sitemap and the assets that are used by these pages. Connect that script to your build process. Every time you release, you call the script after the deployment to rebuild the cache directly, this minimizes the time your website is exposed to uncached pages. Commented Jul 6 at 15:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.