Skip to content

Preserve pre-compressed upstream responses #113

Description

@aram356

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

  1. Inspect upstream response conversion in the Fastly/Cloudflare proxy clients.
  2. 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-Encoding metadata.
  • 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

Activity

  1. changed the title [-]Pre-compressed pass-through[/-] [+]Preserve pre-compressed upstream responses[/+] on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions