fix(cdn): declare the User-Agent cache vary instead of dropping it #156
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/keep-cache-vary"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
tofu planafter importing the middleware script shows:The zone carries
cache_vary_headers = ["User-Agent"], set before this configuration existed.cdn.tfnever declared it, so the first apply of the managed middleware would remove it — as a side effect of an unrelated change, with no decision recorded anywhere.What this changes
Declares the attribute with its current value, so the pull zone is a no-op in that plan.
Why keep it rather than let it go
On paper the router makes it redundant. The only UA-dependent responses it produces are redirects, and those carry
Cache-Control: no-store; their targets are concrete per-slot, per-minor URLs whose content depends only on the path. Dropping the vary would also be a genuine win, since otherwise every distinct R version string (R (4.5.3 x86_64-pc-linux-musl …)) keys its own copy of every tarball.It stays anyway, for now:
no-storeon an edge-script response has been confirmed for today's redirects (cdn-cache: BYPASSonmax-age=0), but not for the new script in productionRemoving it is worth doing on its own, once per-minor routing is confirmed live and the redirects can be observed bypassing cache — not as a side effect of enabling that routing.
Verification
tofu validatepasses. Re-planning after this merges should leavebunnynet_pullzone.cran_rpkgs_comunchanged, reducing the plan to the scriptcontentupdate and the newUNION_SLOTSvariable.