feat(support-matrix): key the edge cache on badge query params#501
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Declare
revalidateQueryAllowlistfor 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 onpathname + 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=25would get whatever image happened to warm the cache first.How
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
exactQueryAllowlist, which drops any*/prefix-wildcard pattern (a fan-out guard, since this cache has no per-path variant cap)./support-matrix.pngand/support-matrix.svgare wildcard-free, so they opt in; a*entry would be a silent no-op here.routing.queryAllowlistis never read on the direct static-candidate path.^(\/|\*$)keys, string-array values) is unaffected.Verification
revalidateQueryAllowlist→queryAllowlistrename → KV routing entry → dispatch static-candidate read).🤖 Generated with Claude Code