# gzip、brotli 与 zstd 的拼接真相

Original title: Compression and Concatenation on the Web

> Hacker News story 50033300 · language: zh · submitted 2026-10-10
> Web version: https://zeli.app/zh/story/50033300
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 8 · by [eatonphil](<https://news.ycombinator.com/user?id=eatonphil>) · 💬 4
[original](<https://theconsensus.dev/p/2026/10/04/compression-and-concatenation-on-the-web.html?focus=1>) · [HN discussion](<https://news.ycombinator.com/item?id=50033300>)

## Summary

大家都以为 gzip 文件可以直接拼接，但浏览器真的支持吗？文章深入探讨了 gzip、brotli 和 zstd 三种主流压缩格式在网页环境下的拼接能力。虽然 gzip 在命令行工具中支持拼接，但直接拼接后的文件在 curl 或 Chrome 中往往会失败，需要借助 zlib 的 gzjoin 工具修复。brotli 原生不支持拼接，但 Dropbox 的 rust-brotli 实现通过特殊标志实现了这一功能。相比之下，zstd 从设计之初就原生支持流式拼接，无需额外工具即可被浏览器完美解析。对于追求极致性能的前端开发者，理解这些差异至关重要。

## Key quote

> 虽然 gzip 在命令行工具中支持拼接，但直接拼接后的文件在 curl 或 Chrome 中往往会失败。

---

## Cite

- Page: https://zeli.app/zh/story/50033300
- Date: 2026-10-10
- Source: theconsensus.dev (https://theconsensus.dev/p/2026/10/04/compression-and-concatenation-on-the-web.html?focus=1)
- Hacker News: https://news.ycombinator.com/item?id=50033300

## Other languages

- en: https://zeli.app/story/50033300 · markdown: https://zeli.app/story/50033300.md
- ja: https://zeli.app/ja/story/50033300 · markdown: https://zeli.app/ja/story/50033300.md
- ko: https://zeli.app/ko/story/50033300 · markdown: https://zeli.app/ko/story/50033300.md
- de: https://zeli.app/de/story/50033300 · markdown: https://zeli.app/de/story/50033300.md
- es: https://zeli.app/es/story/50033300 · markdown: https://zeli.app/es/story/50033300.md
- ru: https://zeli.app/ru/story/50033300 · markdown: https://zeli.app/ru/story/50033300.md
