Add per-cookie template cache policy - #1150
Open
prk-Jr wants to merge 7 commits into
Open
Conversation
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.
Summary
Vary: Cookierefusal.Changes
crates/trusted-server-core/src/creative_opportunities.rscrates/trusted-server-core/src/cookies.rscrates/trusted-server-core/src/cookies/template_cache_policy.rscrates/trusted-server-core/src/platform/template_cache.rscrates/trusted-server-core/src/platform/mod.rscrates/trusted-server-core/src/publisher.rscrates/trusted-server-adapter-fastly/src/template_cache.rstrusted-server.example.tomldocs/guide/configuration.mddocs/superpowers/specs/2026-09-08-1138-per-cookie-template-cache-policy-design.mddocs/superpowers/plans/2026-09-08-1138-per-cookie-template-cache-policy.mdIgnored-value tolerance applies only when independence is asserted. Names, key values, and cookie framing remain validated; unmatched quotes, unsafe bytes, and comma-delimited cookie assignments still bypass. The origin must treat ignored values as opaque and parse semicolon-separated cookies independently; parsers that stop at nonstandard values cannot safely make this assertion.
Closes
Closes #1138
Test plan
The checks below were run during implementation. No local CI gates were rerun for PR creation. Full repository verification passed at
80d462df; after the test-only follow-upba5b88d5, the full Fastly/core suite, Fastly Clippy, and Rust formatting passed again. The compatibility fix atd38c0d3awas verified with 23 focused cookie tests, the full Fastly suite (170 adapter, 2,479 core, 2 JS Rust, and 21 OpenRTB tests), Fastly Clippy, Rust formatting, and formatting of the changed Markdown files. The additional cookie-order fixture passed in a subsequent focused evaluator run.cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest run— 45 files, 893 tests passed.cd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1— not run.fastly compute serve— not run.miss-stored→hitsequences and sessionbypass-request, all HTTP 200. Page JavaScript was disabled to keep cookies stable.Viceroy tests required macOS keychain access, and Axum HTTP tests required loopback socket access. Sandbox-related failures passed after rerunning with the required access.
Checklist
unwrap()in production code.logmacros, notprintln!, per project conventions.