块传输编码 - 浏览器行为 [英] Chunked transfer encoding - browser behavior

查看:118
本文介绍了块传输编码 - 浏览器行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在分块模式发送的数据。所有的头被正确设置和数据连接是codeD相应。浏览器承认我作为一个分块的一个响应,接受头部和开始接收数据。

I'm trying to send data in chunked mode. All headers are set properly and data is encoded accordingly. Browsers recognize my response as a chunked one, accepting headers and start receiving data.

我期待的浏览器将在每个接收块更新页面,而是等待,直到收到所有数据块,然后显示它们。这是预期的行为?

I was expecting the browser would update the page on each received chunk, instead it waits until all chunks are received then displays them all. Is this the expected behavior?

我期待看到每块显示它收到之后。当使用卷曲,每块显示在接收之后。为什么同样不是GUI浏览器发生呢?他们使用某种形式的缓存/缓存?

I was expecting to see each chunk displayed right after it was received. When using curl, each chunk is shown right after it is received. Why does the same not happen with GUI browsers? Are they using some sort of buffering/cache?

我在的Cache-Control 头设置为无缓存,所以不知道它是关于缓存。

I set the Cache-Control header to no-cache, so not sure it is about cache.

推荐答案

据我所知的浏览器需要一定的有效载荷开始呈现大块,因为他们收到。

卷曲当然是个例外。

afaik browsers needs some payload to start render chunks as they received.
Curl is of course an exception.

试试你的第一个块之前,将有关的任意数据1KB。

Try to send about 1KB of arbitrary data before your first chunk.

如果你正确地做每件事,浏览器应他们收到渲染块。

If you are doing everything correctly, browsers should render chunks as they received.

这篇关于块传输编码 - 浏览器行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆