Page Rendering
Choose when each page is built: Static, Dynamic, or Dynamic, cached, and what each means for content updates from WordPress, Sanity and other sources.
Page Rendering
Each page has a rendering mode that decides when it is built. That choice decides how fast the page loads and how soon visitors see content you change in your CMS.
| Mode | When the page is built | Good for |
|---|---|---|
| Static (default) | When you publish | Landing pages, about pages, anything that rarely changes |
| Dynamic | On every visit | Pages that must always be current, or that respond to the visitor (search, filters, signed-in content) |
| Dynamic, cached | On demand, then reused for a while | Blogs and listings that change a few times a day |
You set the mode per page, so one site can mix all three.
Static
The page is built when you publish and served as ready-made HTML. It's the fastest option.
Content from WordPress, Sanity or WooCommerce on a static page is the content as it was at the last build. To show new content, the site has to build again: publish again, or set up a deploy hook so your CMS triggers a redeploy whenever you publish a post.
Static pages can still be interactive. Pick Dynamic only when a page must show changes without a new build.
Dynamic
The server builds the page for each visitor (server-side rendering), so CMS changes show immediately and the page can respond to the visitor.
Dynamic pages need server-capable hosting (Vercel or Cloudflare). Each visit runs server code, so a dynamic page can be slower than a static one.
Dynamic, cached
The page is built when someone requests it, then your host's CDN reuses that copy for a while before building a new one. Choose how long under Keep each version for: 1 min, 5 min (the default), 15 min or 1 hour.
CMS changes show once the cached copy expires. Caching is done by the host: on Vercel the CDN keeps each version; on hosts that ignore the cache header, the page behaves like Dynamic.
Set a page's rendering mode
- Click the page name at the top of the Builder to open the page switcher.
- Click the gear next to the page to open Page settings.
- Under How should this page render?, pick Static, Dynamic or Dynamic, cached.
- Click Save & publish so the live site uses the new mode, or Save to publish later.
You also pick a mode when you create a page, with New page in the page switcher or in Site ▾ › Site Map. The page switcher shows each page's mode as a Static, Dynamic or Cached badge.
Visitors get the new mode after you publish; the site rebuilds in a minute or two.
Warnings
Page settings warns you when a mode doesn't fit the page:
- A template page set to Static. A page like
src/pages/blog/[slug].astromakes many URLs. To build it ahead of time it needsgetStaticPaths()listing them. Keep it Dynamic, or addgetStaticPaths()in the code. You can't save this combination until one of those is true. - A static page that reads per-visit information, such as cookies, query parameters, request headers or the visitor's IP. These only work when the page renders on each visit.
What each mode means for content updates
| Change | Static | Dynamic | Dynamic, cached |
|---|---|---|---|
| New or edited content in WordPress, Sanity or WooCommerce | After the next build (publish or deploy hook) | Right away | When the cached copy expires |
| Content collection entries, data files, lists in a page | After you publish | After you publish | After you publish |
| Design and code changes | After you publish | After you publish | After you publish |
Collections, data files and lists written in a page are files in your project, so they change only when you publish, whatever the page's mode.
The editor's preview always shows the latest WordPress content, whatever the page's mode. To make refreshes faster while you edit, turn on Cache external data in the preview's View options; the refresh button then fetches fresh data.
Deploy hooks for static pages
A deploy hook is a URL that rebuilds and redeploys your site when your CMS calls it. With one in place, static pages pick up new posts on their own, without you opening the editor. Set it up in Publish ▾ › Deploy hook. See Deploy Hooks.
Next steps
- Data Sources: connect WordPress or Sanity and show content on pages
- Deploy Hooks: redeploy when content changes
- Publishing: put your changes on the live site