Static-first delivery and performance

Understand static HTML delivery on a VPS and the fallback for previews and pages that have yet to be generated.

One release, two request paths
Generate at publish time
  1. Editor saves content
  2. Background job generates HTML
  3. Public release switches
Serve at request time

Nginx on the VPS forwards visitor requests to Node.js

  • A public release is readyReturn SSG HTML directly

    Node.js reads the published file from persistent storage. The FILE response header value identifies file delivery.

  • Editor preview or first release pendingFall back to SSR

Node.js can fall back to SSR if a published HTML file becomes unreadable.

Start production on a VPS with 2 vCPUs and 4 GB of RAM. The public site delivers published HTML from local files. Previews and unreadable artifacts can use SSR. VPS deployment guide

Published files on Node

Standalone and container deployments select eligible public URLs with CMS_STATIC_DOCUMENT_URLS and store released files in a private persistent CMS_STATIC_DOCUMENT_DIR. Replicas on one Compose host can share the volume. A request served from the published file reports X-Sitenera-Static-Document: FILE. In the local check, this path used zero SQL and zero Redis commands. The Redis page-cache hit for the same homepage used one Redis command. Verification report

Repeat requests to one public URL

Replace the example with your site’s canonical URL. Use the same URL, request conditions, and client location throughout the run. These anonymous GET requests record status, cache headers, time to first byte, and total download time.

url=https://www.example.com/ja-jp/
for run in 1 2 3 4 5; do
  curl -sS --compressed -o /dev/null -D - \
    -w 'status=%{http_code} ttfb=%{time_starttransfer}s total=%{time_total}s bytes=%{size_download}\n' \
    "$url" | awk '/^(HTTP\/|status=)/ || tolower($0) ~ /^(age|x-sitenera-static-document|cache-control|content-encoding|etag):/'
done
  • On the origin response, X-Sitenera-Static-Document: FILE identifies a published file served by Node. If Nginx caches HTML, use its cache status to distinguish a cache hit from an origin response. The first request can also hit an existing cache.
  • Keep separate samples for each locale and report the median and sample count. Curl’s TTFB and transfer timings exclude browser layout and painting.

Check freshness after publishing

Change a recognizable heading on a test page. Save, revisit the public URL, and record when the new content first appears. Check each locale. Track anonymous URLs, query strings, visitor consent states, and editor previews separately. When using versioned static delivery, verify that the active response version has changed before comparing cache behavior across releases.

Check, roll back, or disable a static release

If visitors still see old content after a save, confirm the URL and locale, then inspect the Nginx response. Use X-Sitenera-Static-Document: FILE and the body to verify the published version. If the origin is current, inspect Nginx full-page caching and the browser cache.

Inspect a release on the VPS

Choose the command for your deployment. Run the standalone command from the project root with an .env.standalone that points to the deployed site’s publication directory. Run the Compose command in the deployed Compose project, where web is the public-site service.

node --env-file=.env.standalone ./deploy/standalone/sitenera/server/static-documents.mjs status https://example.test/ja-jp
docker compose exec web node ./dist/server/static-documents.mjs status https://example.test/ja-jp

Check the returned url and release. A null release means the selected directory contains no publication pointer for that address. After confirming the URL and directory, replace status with an operation below and append --yes after the URL.

Situation Operator action Verify afterward
The new HTML is wrong and readers need the preceding release Run rollback for the same URL with --yes Public HTML returns to the preceding artifact. CMS content retains its current value.
A page is being retired, moved, or restricted Run disable with --yes Normal visitor routing resumes. Then handle the entry using the editorial handbook.
The issue is fixed and static delivery can resume Run restore with --yes Confirm the resumed artifact, or wait for the next warm job, then recheck public content.

After a change, check the origin body first and then the original address and locale through the public hostname. Keep assets referenced by the current and previous releases until verification is complete.

See the deployment guide before going live.