Skip to main content

Module isr_manifest

Module isr_manifest 

Source
Expand description

ISR build manifest — dist/.ssg/manifest.json.

The manifest maps every output URL to its exact source dependency set (markdown file + layout + partials + data files) plus a content hash of those dependencies. The Edge renderer consults this manifest to (a) find which sources to fetch from KV / Edge Config, and (b) detect cache invalidation when sources change.

Shape (canonical, stable):

{
  "version": 1,
  "generated_at": "<rfc3339 timestamp or build-id>",
  "default_cache": { "s_maxage": 60, "swr": 86400 },
  "entries": {
    "/posts/foo/index.html": {
      "sources": ["content/posts/foo.md", "templates/post.html"],
      "hash": "<sha256-hex>",
      "cache": { "s_maxage": 600, "swr": 3600 }
    }
  }
}

cache is omitted at the entry level when the page wants the site-wide default (default_cache). Per-route overrides come from frontmatter (isr.s_maxage, isr.swr).

§Determinism

Entries are written in lexicographic URL order so the manifest is byte-stable for a given input set — critical for CDN cache keys and reproducible builds.

Structs§

CachePolicy
Per-page Cache-Control knobs.
Manifest
Complete ISR build manifest — emitted as dist/.ssg/manifest.json.
ManifestEntry
One entry in the ISR manifest — describes how one URL renders.

Constants§

DEFAULT_SWR
Default stale-while-revalidate (seconds). 24 h matches the Cache-Control: stale-while-revalidate=86400 snippet in the architecture doc.
DEFAULT_S_MAXAGE
Default s-maxage (seconds) the manifest emits when a page does not override via frontmatter. 60 s tracks the per-route SLA quoted in issue #546.
MANIFEST_VERSION
Schema version of the manifest. Bump when the on-disk shape changes in a way edge adapters need to detect.

Functions§

build_entry
Builds a ManifestEntry from sources + their bytes.
hash_sources
Computes the canonical SHA-256 hex digest for a set of source bytes.