Add opt-in SSAT compression offload#884
Open
ChristianPavilonis wants to merge 2 commits into
Open
Conversation
6 tasks
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
publisher.ssat_compression_offload_enabledrollout guardX-Compress-Hint: onDecision and measurement
The staging experiment found that identity-origin plus Fastly delivery compression reduced guest processing from approximately 44.6 ms to 9.0 ms and Fastly vCPU from 47 ms to 19 ms on the measured page. Browser delivery remained Brotli-compressed.
Because identity origin responses are substantially larger and still count against the current Fastly 10 MiB raw origin-response limit, this PR exposes the behavior as a publisher-level opt-in rather than changing the global default.
Behavior
When all three conditions are true:
publisher.ssat_compression_offload_enabled = trueTrusted Server sends
Accept-Encoding: identityto the publisher origin. Supported gzip, deflate, or Brotli responses from origins that ignore the request are still decoded safely. Processed HTML leaves the guest withoutContent-Encoding, carriesX-Compress-Hint: on, and varies onAccept-Encodingfor Fastly delivery.Axum, Cloudflare, and Spin explicitly declare the capability unavailable and retain existing compression behavior even when the shared setting is enabled.
Validation
cargo fmt --all -- --checkcargo test-fastlycargo test-axumcargo test-cloudflarecargo test-spincargo clippy-fastlycargo clippy-axumcargo clippy-cloudflarecargo clippy-cloudflare-wasmcargo clippy-spin-nativecargo clippy-spin-wasmcargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test paritycd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd crates/trusted-server-js/lib && node build-all.mjsnpx --yes prettier@3.8.1 --check docsCloses #858