1. Pre-Rendered (SSG)

This page is built once at deploy time and served as plain HTML from the CDN. The values below are frozen until the next deployment.

🔷 Pre-Rendered (SSG)

Rendering: Build Time

Build Time: 2026-05-12T13:44:46.224Z

Random Number: 774

This value is frozen at build time. Refresh to see it doesn't change.

src/pages/rendering-demo-prerender.astro
---
// No prerender flag needed - SSG is the project default
import BaseLayout from '../layouts/BaseLayout.astro';
import PreRendered from '../components/PreRendered.astro';
---

<BaseLayout title="Pre-Rendered (SSG) Demo">
  <PreRendered />
</BaseLayout>

What to notice

  1. Refresh the page - the timestamp and random number do not change
  2. The HTML was generated at build time and is now cached on the CDN
  3. Fastest possible page - zero server compute per visit
  4. Heads up: in dev mode the values do change. SSG locking only kicks in after a build

When to use in WordPress

  • Blog posts & pages - content rarely changes between deploys
  • Marketing pages - hero, about, services, landing pages
  • Product catalogs with infrequent updates
  • Pair with a WordPress webhook on post save to trigger a rebuild (Vercel/Netlify deploy hook)
  • Use getStaticPaths() to pre-build every WP post at deploy time