adobe / adobe/helix-deploy-plugin-edge

Add fastly.decompressGzip option for automatic decompression

Open
#81 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Background

Per [adobe/helix-deploy-plugin-edge#77](https://github.com/adobe/helix-deploy-plugin-edge/pull/77) and [comment](https://github.com/adobe/helix-deploy-plugin-edge/pull/77#issuecomment-3554569809), @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:

```javascript
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:

1. Accept `fastly.decompressGzip` in options
2. Map to platform-appropriate behavior
3. Document as the cross-platform way to control decompression

Contributor guide

Open the contributing guide

Research direction

Start by locating @adobe/fetch's existing compression handling and platform-specific option mapping. Verify that fastly.decompressGzip is accepted, passed through on Fastly, ignored on Cloudflare, and mapped to the existing compress/decode behavior in Node.js; document the cross-platform option.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.