Skip to content

feat(support-matrix): key the edge cache on badge query params#501

Merged
Brooooooklyn merged 1 commit into
mainfrom
feat/support-matrix-edge-cache-allowlist
Jul 13, 2026
Merged

feat(support-matrix): key the edge cache on badge query params#501
Brooooooklyn merged 1 commit into
mainfrom
feat/support-matrix-edge-cache-allowlist

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

What

Declare revalidateQueryAllowlist for the /support-matrix.{png,svg} badge routes so each query variant caches independently at the edge.

Why

The badge renders a different image per query (engines, nodeTested, nodeOmit, tested, …), but dispatch's static-candidate edge cache keys only on pathname + version. So the first render for a given path was served to every later request regardless of query — all badge variants collapsed onto one cached image. A lzma README embedding ?…&nodeOmit=25 would get whatever image happened to warm the cache first.

How

void.json  routing.revalidateQueryAllowlist
   └─ /support-matrix.png → [10 params]
   └─ /support-matrix.svg → [10 params]
        │  (config field)
        ▼  renamed at deploy → routing.queryAllowlist  (api/src/routing.ts)
        ▼  read by dispatch static-candidate cache via
           exactQueryAllowlist(routing.queryAllowlist)  (dispatch #232, deployed)
        ▼  cache key now includes the allowlisted params → per-variant caching

The param list is exactly the 10 the query parser reads (lib/support-matrix/query.ts): tested, nonblocking, untested, omit, wasm, name, engines, nodeTested, nodeOmit, theme. Any param omitted from the list would silently share a cache slot, so the list is kept in lockstep with the parser.

Notes

  • Exact literal keys required. void-platform chore(deps): lock file maintenance #232 runs the static-candidate allowlist through exactQueryAllowlist, which drops any */prefix-wildcard pattern (a fan-out guard, since this cache has no per-path variant cap). /support-matrix.png and /support-matrix.svg are wildcard-free, so they opt in; a * entry would be a silent no-op here.
  • Depends on void-platform chore(deps): lock file maintenance #232 (merged + deployed) — without it, routing.queryAllowlist is never read on the direct static-candidate path.
  • The schema description still says "for dispatch rewrites"; the chore(deps): lock file maintenance #232 change extended the same field to the static-candidate cache. Validation (^(\/|\*$) keys, string-array values) is unaffected.

Verification

  • JSON valid; both keys match the schema key pattern and are wildcard-free.
  • Param arrays verified equal to the parser's exact set.
  • Full config→cache-key chain traced hop-by-hop in the deployed void-platform (config parse → deploy manifest → revalidateQueryAllowlistqueryAllowlist rename → KV routing entry → dispatch static-candidate read).

🤖 Generated with Claude Code

The `/support-matrix.{png,svg}` badge renders a different image per query
(engines, nodeTested, nodeOmit, tested, …), but dispatch's
static-candidate edge cache keys only on pathname+version — so the first
render for a given path was served to every later request regardless of
query, collapsing all badge variants onto one image.

Declare `revalidateQueryAllowlist` for both routes listing exactly the 10
params the query parser reads (tested, nonblocking, untested, omit, wasm,
name, engines, nodeTested, nodeOmit, theme). With void-platform #232
deployed, the static-candidate cache now projects these exact-path
allowlisted params into its key, so each query variant caches
independently. Exact literal keys (no wildcard) are required — a `*`
entry is dropped by the platform's exactQueryAllowlist fan-out guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Brooooooklyn
Brooooooklyn merged commit cdd318d into main Jul 13, 2026
2 checks passed
@Brooooooklyn
Brooooooklyn deleted the feat/support-matrix-edge-cache-allowlist branch July 13, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant