Zstd buffering response/streaming broken again

What is the name of the domain?

example.com

What is the error number?

What is the issue you’re encountering

zstd buffers the whole response from origin before sending it to the client

What steps have you taken to resolve the issue?

This issue was reported previously Zstd prevents text/html streaming output (Free Plan) and a part of it was fixed Cloudflare Status - Issues with Zstd compression

However the issue still exists:
when zstd recompressing, Cloudflare waits for the whole response before sending it to the client instead if forwarding it 1:1 like with brotli.

This is a massive problem on large internal (e.g. administrative interfaces) pages that can take multiple seconds to load fully.

What are the steps to reproduce the issue?

send first part of response (at least 4k bytes to ensure it’s not buffered by something else)
sleep 10 seconds
send rest of the response

when the request has Accept-Encoding br you will see the first part in the browser immediately, the 2nd part after 10 seconds
when the request has Accept-Encoding zstd you will see nothing for 10 seconds, and then everything.

@mbullock could you take a look at this? It affects all plans

I wonder why nobody has reported that yet, but I guess this something like the recent xz backdoor slowness What we know about the xz Utils backdoor that almost infected the world - Ars Technica nobody really is aware of.

Is there any way to make Cloudflare aware of this issue/get a reply?

对于这里提到的修复,是对站点关闭了zstd功能,而不是修复了页面错误(也就是只返回br压缩) Cloudflare Status - Issues with Zstd compression

是的,zstd目前依旧有问题
image

cloudflare发送了zstd的错误数据,观察chrome响应头未包含 content-encoding: zstd 导致浏览器输出了错误的信息一大堆乱码,并且数据被截断,65KB的页面内容只获得了19KB

截至目前2024年10月29日,zstd的该问题依然存在还未修复

你可以通过这个方式来禁用zstd压缩

入口
https://dash.cloudflare.com/?to=/:account/:zone/rules/compression-rules

如果你能忍受zstd产生的页面错误,请等待cloudflare开发人员更新修复
image

This topic was automatically closed after 15 days. New replies are no longer allowed.