NuxtN
Nuxt3y ago
Shiri

SWR problem (or cache problem)

Hello, I have a problem on my website with cached content. Can somebody explaine me how the SWR should work or where is my problem.
I have a blog with articles, articles are fetched by useAsyncData from API. When I do change in the article in the backend the change is visible when I use router within the app (cliend side). But when I go directly to the URL (SSR) it shows old content (from the First time I visited it).
My routeRules is set like this:
routeRules: {
    "/**": { swr: 60 },
  },

With this, I assumed it should update after 60 second after first visit (or even maybe in between on background), but it wont.
Can somebody explane to me where is the problem? Or did I get working of SWR wrong? Using Nuxt 3.5.1 with Nitro 2.4.1
Was this page helpful?