Repository navigation
Description
Description
Offer an explicit pass-through mode that retains an upstream response's encoded bytes instead of always decoding and later recompressing them.
Fastly and Cloudflare proxy conversion currently feeds upstream streams through decode transforms; Spin similarly decompresses supported encodings. Main exposes no portable pass-through selection on the single-request proxy interface.
Steps to reproduce
- Inspect upstream response conversion in the Fastly/Cloudflare proxy clients.
- Compare the proxy request/options surface with the required encoded pass-through mode.
Expected behavior
Applications can deliberately preserve a compatible upstream representation with its correct encoding metadata.
Impact
A proxy may spend CPU decoding/re-encoding content and cannot consistently preserve an origin representation across providers.
Proposed fix
Define a portable decode-versus-preserve policy and implement it across proxy clients, accounting for provider-managed decoding and client encoding compatibility. Coordinate with #275 and #452.
Done when
- Pass-through preserves supported encoded bytes and matching
Content-Encodingmetadata. - Decode mode still removes/recomputes representation headers correctly.
- No double compression occurs and incompatible client encodings have defined behavior.
- Tests exercise encoded upstream responses on each supported adapter and document provider constraints.
Related
- Parent: Complete streaming and compression across adapters #107.
- Automatic outgoing compression: Automatically compress responses from Accept-Encoding #111.
- Fastly upstream decode path
- Cloudflare upstream decode path
- Current single-request outbound interface
- Implementation PR feat: implement portable outbound HTTP and request lifecycle contracts #275 supplies explicit
ResponseDecoding::Original, shared encoded-body/header preservation, all-adapter wiring and controlled local relay coverage. Keep this issue open until its complete scope is accepted and merged; PR Add explicit adapter delivery compression support #452 remains related delivery-compression work. - Related PR Add explicit adapter delivery compression support #452; this PR alone does not establish completion of this issue.
Activity
[-]Pre-compressed pass-through[/-][+]Preserve pre-compressed upstream responses[/+]