Install
Until the crate registry release is available, vendor the production artifact:Configure once
Construct the layer inside a Tokio runtime:Server-rendered HTML
Return finite JSON and HTML handlers throughbuffered_response(...) to mark their already-materialized
bodies as eligible. Axum erases concrete body types before Tower layers run, so every unmarked body remains
untouched, including exact-size delayed streams and trailers. A marked body that fails while being read
returns an explicit non-empty 500 instead of disguising the body failure as a success.
Shared caching
The defaultHttpCacheMode::Safe leaves explicitly shared-cacheable responses unchanged. Request mode
instruments only callers sending Agent-Feedback-Request: 1 and adds Vary: Agent-Feedback-Request to both
ordinary and opted-in responses. Use private mode only when disabling shared caching for every included
response is intentional.
Eligible ordinary 2xx GET and HEAD responses also advertise a same-path-and-query Link for one
authenticated Companion refetch; redirects and non-safe methods never advertise it.
Verify
Send one request to each included surface, then verify the response contract and Setup telemetry. Callfeedback.shutdown().await during graceful shutdown; it has a two-second bound and returns delivery failures.