Public: anyone can read this; the crew can change it.
Signed-out /pricing and /templates are kept by the edge for a minute, like / and /explore #14667
Check · Review · Land · Live done — Landed and live in production.
A signed-out GET of /pricing or /templates now answers public, max-age=0, s-maxage=60, stale-while-revalidate=300, with Vary carrying EDGEVARY. I changed sharedPath in src/http/edgecache.ts and extended test/web-budget.test.ts.
shipped production is serving it deploy 4ec2c16
A signed-out GET of /pricing or /templates now answers public, max-age=0, s-maxage=60, stale-while-revalidate=300, with Vary carrying EDGE_VARY. I changed sharedPath in src/http/edge_cache.ts and extended test/web-budget.test.ts. That test file and tsc pass; I didn't run the other test files, and bun scripts/gate.ts --fix rewrapped comments in one file, which is in the commit.
Check of the signed-out bodies. Neither page has a per-visitor value in what a signed-out visitor receives, so both are shared.
/pricing: the order form carries no CSRF token or nonce. Theforge_ordercookie only changes the page when a cookie is sent, and a request with any cookie is never given the shared copy./templates: the list, the "what it holds" rows and the usage counts are the same for every signed-out visitor.- Query strings:
?name=and?q=change the body, so they are part of the address the edge keys on.
Tests. The new test fetches each page twice signed out with different x-request-id values and asserts the bodies are byte-identical. It also asserts s-maxage=60 and Vary containing EDGE_VARY signed out, and no s-maxage with the admin cookie or with a stray cookie. It calls sharedCache directly too. I put it in test/web-budget.test.ts next to the existing / and /explore edge tests rather than creating a new file.
Not done. Per atlas's note, the edge reports cf-cache-status: DYNAMIC even for /. These pages won't actually be kept until the owner adds an edge cache rule. This change proves the headers and the byte-identical bodies, not a cache hit.
To try. Run curl -sI <app>/pricing and curl -sI <app>/templates and read cache-control and vary. Repeat with -H 'cookie: a=b' to see that s-maxage is gone.
Clean, minimal change. Preview: signed-out /pricing and /templates answer public, s-maxage=60 with Vary carrying EDGE_VARY; with a cookie, private no-cache. Neither signed-out body carries a CSRF token or nonce (checked on the preview), and the cookie-only forge_order variation is never served from the shared copy. Test asserts both paths signed out/in, stray cookie, byte-identical bodies across request ids, and sharedCache directly.
A signed-out GET of
/pricingor/templatesnow answerspublic, max-age=0, s-maxage=60, stale-while-revalidate=300, withVarycarryingEDGE_VARY. I changedsharedPathinsrc/http/edge_cache.tsand extendedtest/web-budget.test.ts. That test file andtscpass; I didn't run the other test files, andbun scripts/gate.ts --fixrewrapped comments in one file, which is in the commit.Check of the signed-out bodies. Neither page has a per-visitor value in what a signed-out visitor receives, so both are shared.
/pricing: the order form carries no CSRF token or nonce. Theforge_ordercookie only changes the page when a cookie is sent, and a request with any cookie is never given the shared copy./templates: the list, the "what it holds" rows and the usage counts are the same for every signed-out visitor.?name=and?q=change the body, so they are part of the address the edge keys on.Tests. The new test fetches each page twice signed out with different
x-request-idvalues and asserts the bodies are byte-identical. It also assertss-maxage=60andVarycontainingEDGE_VARYsigned out, and nos-maxagewith the admin cookie or with a stray cookie. It callssharedCachedirectly too. I put it intest/web-budget.test.tsnext to the existing/and/exploreedge tests rather than creating a new file.Not done. Per atlas's note, the edge reports
cf-cache-status: DYNAMICeven for/. These pages won't actually be kept until the owner adds an edge cache rule. This change proves the headers and the byte-identical bodies, not a cache hit.To try. Run
curl -sI <app>/pricingandcurl -sI <app>/templatesand readcache-controlandvary. Repeat with-H 'cookie: a=b'to see thats-maxageis gone.Closes #14658