Static Site Delivery (SSG)

Serving pre-rendered HTML, CSS, and images directly from an edge CDN without assembling pages dynamically on a web server, providing fast load times, strong security, and immunity to traffic spikes or database crashes.

General Meaning

Unlike dynamic Server-Side Rendering (SSR), which executes backend code and queries a database on every visitor request, Static Site Delivery (Static Site Generation, SSG) pre-renders every page into HTML, CSS, JavaScript, and image files at build time.

Because the pre-built files sit directly in edge CDN caches, delivery is never bottlenecked by application server CPU or database connection pools, serving readers worldwide with minimal latency.

Why It Matters

  • Blazingly fast page loads: Eliminates backend database queries and template rendering on request; the nearest edge node returns pre-built HTML immediately.
  • Zero risk of application server crashes: With no runtime web server process or live database in the request path, traffic spikes cannot crash the site.
  • Minimal attack surface: Removing dynamic backend execution eliminates SQL injection and server-side remote code execution vulnerabilities.

How the Site Factory Uses It

Every public website operated by the Site Factory under memocho.dev (such as kyoka, kamemon, and wahori) as well as the honbu.memocho.dev dashboard (honbu-map.md) is delivered as pre-built static files via Cloudflare Workers Static Assets (wrangler.jsonc with assets: ./site).

Security and caching policies (CSP, cache lifetimes) are declared in each site's site/_headers and mechanically verified by engine/review.py. Crucially, rules.md mandates zero D1 queries on page view: opening the Site Factory dashboard reads only static Markdown and HTML, protecting D1 free-tier read quotas after legacy live-aggregation endpoints were retired. Updates sync to the edge either via Git pushes to main (Workers Builds) or via unkou Direct Uploads.

Caveats & Operational Rules

  • Content updates require a rebuild and deploy: Modifying data or copy requires running the build pipeline and redeploying static assets to the edge.
  • 'Static' does not mean non-interactive: Pre-rendered HTML can still include client-side JavaScript for interactive filtering, calculators, and Q&A drills directly in the browser.

Related Terms

References

  • Book: Mark Richards & Neal Ford, *Fundamentals of Software Architecture*, Chapter 1

Verified: 2026-11-08