docs: improve swr documentation (#18743)

This commit is contained in:
Alan Poulain 2023-03-20 00:44:06 +01:00 committed by GitHub
parent 11ee3c92b9
commit 97ae4e23f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,9 @@ Nuxt 3 includes route rules and hybrid rendering support. Using route rules you
- `ssr` - Disables server-side rendering for sections of your app and make them SPA-only with `ssr: false` - `ssr` - Disables server-side rendering for sections of your app and make them SPA-only with `ssr: false`
- `cors` - Automatically adds cors headers with `cors: true` - you can customize the output by overriding with `headers` - `cors` - Automatically adds cors headers with `cors: true` - you can customize the output by overriding with `headers`
- `headers` - Add specific headers to sections of your site - for example, your assets - `headers` - Add specific headers to sections of your site - for example, your assets
- `static` and `swr` - `static` enables a single (on-demand) build; `swr` enables a static build, that lasts for a configurable TTL. (currently enables full incremental static generation on Netlify, with Vercel coming soon) - `swr` - Add cache headers to the server response and cache it in the server or reverse proxy for a configurable TTL. The `node-server` preset of Nitro is able to cache the full response. For Netlify and Vercel, the response is also added to the CDN layer.
- `static` - The behavior is the same as `swr` except that there is no TTL; the response is cached until the next deployment. On Netlify and Vercel, it enables full incremental static generation.
- `prerender` - Prerenders routes at build time and includes them in your build as static assets
**Examples:** **Examples:**