---
title: "Rendering and caching · Sanity × Nuxt UI"
description: "Choose between server rendering, hybrid prerendering and a static site, and how pages are cached."
canonical_url: "https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching"
meta:
  "og:description": "Choose between server rendering, hybrid prerendering and a static site, and how pages are cached."
  "og:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Rendering%2Band%2Bcaching%2Cdescription_~Q2hvb3NlIGJldHdlZW4gc2VydmVyIHJlbmRlcmluZywgaHlicmlkIHByZXJlbmRlcmluZyBhbmQgYSBzdGF0aWMgc2l0ZSwgYW5kIGhvdyBwYWdlcyBhcmUgY2FjaGVkLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL3JlbmRlcmluZy1hbmQtY2FjaGluZyI%2Cs_5YzyxuM1QxtPI5Lb.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Rendering and caching · Sanity × Nuxt UI"
  "twitter:image": "https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Rendering%2Band%2Bcaching%2Cdescription_~Q2hvb3NlIGJldHdlZW4gc2VydmVyIHJlbmRlcmluZywgaHlicmlkIHByZXJlbmRlcmluZyBhbmQgYSBzdGF0aWMgc2l0ZSwgYW5kIGhvdyBwYWdlcyBhcmUgY2FjaGVkLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL3JlbmRlcmluZy1hbmQtY2FjaGluZyI%2Cs_5YzyxuM1QxtPI5Lb.png"
---

> Index of every page on this site: [llms.txt](https://sanity-nuxtui.vercel.app/llms.txt)

Halaman ini belum tersedia dalam bahasa Indonesia.

[Docs](https://sanity-nuxtui.vercel.app/id/docs)

# **Rendering and caching**

Choose between server rendering, hybrid prerendering and a static site, and how pages are cached.

## Rendering modes

Pick one with `NUXT_RENDER_MODE` at build time:

| **Mode** | **Build** | **Content changes appear** | **Needs a server** |
| --- | --- | --- | --- |
| `ssr` (default) | `pnpm build` | within `NUXT_CACHE_TTL` seconds (default 60) | yes |
| `hybrid` | `NUXT_RENDER_MODE=hybrid pnpm build` | new pages right away, edits after a rebuild | yes |
| `static` | `pnpm generate` | after a rebuild | no |

- ****ssr**** renders on demand and caches the result. The best default.
- ****hybrid**** prerenders every page, collection and entry at build time and serves them as static files. The server still renders pages added after the build, social images and previews.
- ****static**** prerenders everything into `apps/web/.output/public`, including social images, the sitemap and the data for client-side navigation. Upload that folder to any static host. Visual Editing needs a separate `ssr` deployment.

The list of URLs to prerender comes from Sanity (`prerender-routes.ts`), in every language, because the crawler only finds pages something links to.

**Rebuild on publish**

For hybrid and static, create a deploy hook on your host and add it as a webhook in sanity.io/manage → API → Webhooks, filtered to type in \["page", "collection", "entry", "author", "settings"].

## Caching

In `ssr` mode, pages are cached and refreshed in the background: visitors get a cached page instantly, and edits appear within `NUXT_CACHE_TTL` seconds of publishing.

| **Platform** | **Mechanism** |
| --- | --- |
| Vercel | ISR (`isr` route rule). The `tag` query is part of the cache key |
| Cloudflare, Node | Stale-while-revalidate (`swr` route rule) |

`/_og/**`, `/api/**`, `/_sanity/**` and `/preview/**` are never cached by these rules. Set `NUXT_CACHE_TTL=0` to turn caching off.

With a read token for Visual Editing, Vercel keeps caching and lets editors skip it; other hosts turn caching off. See [**Visual Editing**](https://sanity-nuxtui.vercel.app/docs/visual-editing).

## Page data

In `ssr` mode the page data is embedded in the HTML, so a cached page always hydrates with the data it was rendered with. In `hybrid` and `static` modes, page data is extracted to payload files for client-side navigation.

[**SEO and social images** Meta tags, sitemap, robots, structured data and the generated social images.](https://sanity-nuxtui.vercel.app/id/docs/seo-and-social-images) [**Deployment** Host the Studio on Sanity and the site on Vercel, Cloudflare or any Node server.](https://sanity-nuxtui.vercel.app/id/docs/deployment)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://sanity-nuxtui.vercel.app/#website","@type":"WebSite","name":"Sanity × Nuxt UI","url":"https://sanity-nuxtui.vercel.app/","publisher":{"@id":"https://sanity-nuxtui.vercel.app/#identity"}},{"@id":"https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching#webpage","@type":"WebPage","dateModified":"2026-10-16T02:29:18Z","description":"Choose between server rendering, hybrid prerendering and a static site, and how pages are cached.","name":"Rendering and caching","url":"https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching","isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching"]}]},{"@id":"https://sanity-nuxtui.vercel.app/#identity","@type":"Organization","name":"Sanity × Nuxt UI","url":"https://sanity-nuxtui.vercel.app"},{"@id":"https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching#article","@type":"Article","dateModified":"2026-10-16T02:29:18Z","description":"Choose between server rendering, hybrid prerendering and a static site, and how pages are cached.","headline":"Rendering and caching","inLanguage":"en","thumbnailUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Rendering%2Band%2Bcaching%2Cdescription_~Q2hvb3NlIGJldHdlZW4gc2VydmVyIHJlbmRlcmluZywgaHlicmlkIHByZXJlbmRlcmluZyBhbmQgYSBzdGF0aWMgc2l0ZSwgYW5kIGhvdyBwYWdlcyBhcmUgY2FjaGVkLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL3JlbmRlcmluZy1hbmQtY2FjaGluZyI%2Cs_5YzyxuM1QxtPI5Lb.png","author":{"@id":"https://sanity-nuxtui.vercel.app/#identity"},"image":{"@id":"https://sanity-nuxtui.vercel.app/#/schema/image/1"},"isPartOf":{"@id":"https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching#webpage"},"mainEntityOfPage":{"@id":"https://sanity-nuxtui.vercel.app/id/docs/rendering-and-caching#webpage"},"publisher":{"@id":"https://sanity-nuxtui.vercel.app/#identity"}},{"@id":"https://sanity-nuxtui.vercel.app/#/schema/image/1","@type":"ImageObject","contentUrl":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Rendering%2Band%2Bcaching%2Cdescription_~Q2hvb3NlIGJldHdlZW4gc2VydmVyIHJlbmRlcmluZywgaHlicmlkIHByZXJlbmRlcmluZyBhbmQgYSBzdGF0aWMgc2l0ZSwgYW5kIGhvdyBwYWdlcyBhcmUgY2FjaGVkLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL3JlbmRlcmluZy1hbmQtY2FjaGluZyI%2Cs_5YzyxuM1QxtPI5Lb.png","inLanguage":"en","url":"https://sanity-nuxtui.vercel.app/_og/d/c_Page%2Ctitle_Rendering%2Band%2Bcaching%2Cdescription_~Q2hvb3NlIGJldHdlZW4gc2VydmVyIHJlbmRlcmluZywgaHlicmlkIHByZXJlbmRlcmluZyBhbmQgYSBzdGF0aWMgc2l0ZSwgYW5kIGhvdyBwYWdlcyBhcmUgY2FjaGVkLg%2Cheadline_Docs%2CsiteName_~U2FuaXR5IMOXIE51eHQgVUk%2Cp_Ii9pZC9kb2NzL3JlbmRlcmluZy1hbmQtY2FjaGluZyI%2Cs_5YzyxuM1QxtPI5Lb.png"}]}
```

## Sitemap

See the full [sitemap](https://sanity-nuxtui.vercel.app/sitemap.md) for all pages.
