admin管理员组文章数量:1434966
The Nuxt 3 documentations says that swr enables a static build, that lasts for a configurable TTL
, however, nowhere was I able to find how exactly one would change the TTL & whether it can be set per-route. Is that possible? If so, how?
I've looked at github & also tried to find it in Vite / Nitro documentation but didn't find anything.
I found something about image TTL in Nitro config source files but I suppose that's not what I was looking for.
The Nuxt 3 documentations says that swr enables a static build, that lasts for a configurable TTL
, however, nowhere was I able to find how exactly one would change the TTL & whether it can be set per-route. Is that possible? If so, how?
I've looked at github & also tried to find it in Vite / Nitro documentation but didn't find anything.
I found something about image TTL in Nitro config source files but I suppose that's not what I was looking for.
Share Improve this question edited Dec 7, 2022 at 7:47 Matej asked Dec 7, 2022 at 7:46 MatejMatej 2717 silver badges24 bronze badges2 Answers
Reset to default 5After some investigation & experimenting, I found out that it is possible to adjust the TTL already! You just set it to an integer value instead of a boolean.
export default defineNuxtConfig({
routeRules: {
'/**': { swr: 5 }, //
本文标签:
javascriptHow to change TTL when using swr in Nuxt 3 (perroute preferably)Stack Overflow
版权声明:本文标题:javascript - How to change TTL when using swr in Nuxt 3? (per-route preferably) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人,
转载请联系作者并注明出处:http://www.betaflare.com/web/1745645534a2668112.html,
本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论