Background
Per adobe/helix-deploy-plugin-edge#77 and comment, @adobe/fetch should support the fastly: { decompressGzip: true } option to align Fastly and Cloudflare's fetch behavior.
Proposal
Add support for the Fastly-specific decompressGzip option within a fastly options object:
import { fetch } from '@adobe/fetch';
const response = await fetch(url, {
fastly: {
decompressGzip: true
}
});
Behavior
- Fastly: Pass through to native
fastly.decompressGzip option
- Cloudflare: No-op (Cloudflare automatically handles decompression)
- Node.js: Map to existing
compress/decode options
Context
Cloudflare Workers automatically decompress gzip responses. Fastly requires explicit opt-in via decompressGzip. Supporting this option in @adobe/fetch allows writing portable code that works identically across platforms.
Implementation Notes
Since @adobe/fetch already handles compression transparently via the compress and decode options (defaults to true), this would primarily be:
- Accept
fastly.decompressGzip in options
- Map to platform-appropriate behavior
- Document as the cross-platform way to control decompression
Background
Per adobe/helix-deploy-plugin-edge#77 and comment, @adobe/fetch should support the
fastly: { decompressGzip: true }option to align Fastly and Cloudflare's fetch behavior.Proposal
Add support for the Fastly-specific
decompressGzipoption within afastlyoptions object:Behavior
fastly.decompressGzipoptioncompress/decodeoptionsContext
Cloudflare Workers automatically decompress gzip responses. Fastly requires explicit opt-in via
decompressGzip. Supporting this option in @adobe/fetch allows writing portable code that works identically across platforms.Implementation Notes
Since @adobe/fetch already handles compression transparently via the
compressanddecodeoptions (defaults totrue), this would primarily be:fastly.decompressGzipin options