SSR Cache

Invalidate SSR ISR cache rows

Invalidate cache rows for one or many {host, path} keys. Discriminated on kind: "exact" deletes one canonical key; "prefix" deletes every key whose path starts with the prefix; "all" deletes every key on the host; "many" deletes a list of URLs (host derived from each URL — every host must belong to the caller's project). Each host MUST be owned by the caller's project (subdomain *.run402.com matching internal.subdomains.name OR custom hostname in internal.domains); cross-project returns 403 R402_CACHE_INVALIDATION_HOST_FORBIDDEN. The DELETE and the per-(project, host) generation bump happen atomically; the returned generation is the post-increment value and gates in-flight MISS writes from overwriting already-invalidated rows. Pairs with @run402/astro v1.0+; capability ssr-isr-cache (v1.52).

post/cache/v1/invalidate

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/cache/v1/invalidate
  • Auth: HTTP bearer

Request body

OR
OR
OR

Response

Single-scope variants (exact, prefix, all) return { deleted, generation, host, path? }; many returns { deleted, generation, host: "", results: [{ host, deleted, generation }] } where the top-level generation is the first host's post-increment (or "0" for empty input).

deletedinteger required

Number of cache rows deleted across all referenced hosts.

generationstring required

Post-increment generation value as a decimal string (bigint).

hoststring required

Echoed host for single-scope variants; empty string for kind: many.

pathstring

Echoed path for kind: exact only.

Changes