开发者

What are the various browser data cache sizes?

开发者 https://www.devze.com 2022-12-15 18:17 出处:网络
Browsers render content after \"enough\" data has been received or once data stops flowing in (Content Length reached, for example).

Browsers render content after "enough" data has been received or once data stops flowing in (Content Length reached, for example).

I want to slowly stream data to the browser; to do this, I have to work around this data caching.

For example, instead of sending 40 bytes of JavaScript, I have to send the 40 bytes of JS followed by about 4 KB of spaces in order to get the browser to interpret the script.

This works fine. But I don't remember where I first heard开发者_StackOverflow中文版 the number "4 KB" and was wondering what the true required amount is per browser.

I could of course write a bunch of tests to find these numbers, but I was curious if anyone has already done this work for me. I am also at a loss for what to ask the Google regarding this.


If you want to know what response size browsers need before rendering content when you flush the response early, I found these numbers buried in a comment in a post about flushing the document early:

IE: 255 bytes
Safari: 1K
Chrome: 2K

If you're looking into this so that you can implement streaming, you might want to look into how various comet implementations handle this.

0

精彩评论

暂无评论...
验证码 换一张
取 消