Skip to content

HTTP compression middleware only supports gzip/deflate, missing zstd #27932

@BYK

Description

@BYK

Describe the bug

The HTTP compression middleware in compression.ts only supports gzip and deflate encoding. Modern browsers (Chrome 123+, Firefox 126+, Safari 18+) send zstd in Accept-Encoding and zstd provides ~30-40% better compression than gzip at similar speeds.

Steps to reproduce

  1. Make a request to the OpenCode server with Accept-Encoding: zstd, gzip
  2. Observe the response uses gzip, not zstd

Expected behavior

The server should negotiate zstd as the preferred encoding when the client supports it, falling back to gzip/deflate.

System info

  • OpenCode version: v1.15.3
  • OS: Linux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions