怎么为application/x-bittorrent添加zstd压缩支持?

What is the name of the domain?

What is the issue you’re encountering

What steps have you taken to resolve the issue?

怎么为application/x-bittorrent添加zstd压缩支持?

通过压缩规则启用zstd后,只有以下正则

"(http.response.content_type.media_type in {\"text/html\" \"text/richtext\" \"text/plain\" \"text/css\" \"text/x-script\" \"text/x-component\" \"text/x-java-source\" \"text/x-markdown\" \"application/javascript\" \"application/x-javascript\" \"text/javascript\" \"text/js\" \"image/x-icon\" \"image/vnd.microsoft.icon\" \"application/x-perl\" \"application/x-httpd-cgi\" \"text/xml\" \"application/xml\" \"application/rss+xml\" \"application/vnd.api+json\" \"application/x-protobuf\" \"application/json\" \"multipart/bag\" \"multipart/mixed\" \"application/xhtml+xml\" \"font/ttf\" \"font/otf\" \"font/x-woff\" \"image/svg+xml\" \"application/vnd.ms-fontobject\" \"application/ttf\" \"application/x-ttf\" \"application/otf\" \"application/x-otf\" \"application/truetype\" \"application/opentype\" \"application/x-opentype\" \"application/font-woff\" \"application/eot\" \"application/font\" \"application/font-sfnt\" \"application/wasm\" \"application/javascript-binast\" \"application/manifest+json\" \"application/ld+json\" \"application/graphql+json\" \"application/geo+json\"})",

8月经过汇报BUG后,cloudflare官方现在已经紧急撤下了zstd压缩功能,现在不会返回zstd内容,返回结果为br

2024年10月1日帖子补充
之前的修复就是"下架"zstd功能,今日重新恢复支持,需要使用压缩规则来添加,点击入口进入设置添加compress
https://dash.cloudflare.com/?to=/:account/:zone/rules/compression-rules


文档:Compression Rules | Cloudflare Rules docs

启用后网站速度快了很多,毕竟CPU解码能力性能翻了好几倍,真正意义上的秒开,对比测试,大概快了40%的页面加载速度
还会不会bug出现乱码问题还要观察一段时间

自问自答
创建压缩规则,规则名compress2,选择媒体类型,包含以下各项

image

部署后即可对 application/x-bittorrent 进行zstd压缩

实测zstd依旧有存在页面异常的bug
image