From a1dc40efdf996a8c59250456e57f765392ee65d3 Mon Sep 17 00:00:00 2001 From: TroyanOlga <63797764+TroyanOlga@users.noreply.github.com> Date: Sat, 27 Jan 2024 22:57:36 +0100 Subject: [PATCH] docs: add fuller explanation in `routeRules` example of swr/isr (#25436) --- docs/2.guide/1.concepts/3.rendering.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/2.guide/1.concepts/3.rendering.md b/docs/2.guide/1.concepts/3.rendering.md index 79c35a91a5..98c40afb9c 100644 --- a/docs/2.guide/1.concepts/3.rendering.md +++ b/docs/2.guide/1.concepts/3.rendering.md @@ -84,9 +84,13 @@ export default defineNuxtConfig({ routeRules: { // Homepage pre-rendered at build time '/': { prerender: true }, - // Product page generated on-demand, revalidates in background + // Products page generated on demand, revalidates in background, cached until API response changes + '/products': { swr: true }, + // Product page generated on demand, revalidates in background, cached for 1 hour (3600 seconds) '/products/**': { swr: 3600 }, - // Blog post generated on-demand once until next deploy + // Blog posts page generated on demand, revalidates in background, cached on CDN for 1 hour (3600 seconds) + '/blog': { isr: 3600 }, + // Blog post page generated on demand once until next deployment, cached on CDN '/blog/**': { isr: true }, // Admin dashboard renders only on client-side '/admin/**': { ssr: false },