#SWR Setup Netlify

4 messages · Page 1 of 1 (latest)

past wing
#

Hello, can someone help me to understand swr settings for netlify? I would like to have swr settings to let's say refetch every 5min.

nuxt config:

  routeRules: {
    "/": { swr: 5 * 60 }, // TTL in seconds
    "/**": { swr: 5 * 60 }, // TTL in seconds
  },

Netlify Deploy settings are: yarn build and output dist. Somehow the site is doing API requests on every route though. So I don't think swr is actually working.

past wing
#

Mhm anyone has suggestions for a working swr mode on Netlify?

long sigil
#

It does API request on every navigation but not page refresh right?

#

If that is the case it is because it uses nuxt-link behind the scene