如果我检查"内容长度"头,是不是100%准确? [英] If I check the "content-length" header, is it 100% accurate?
本文介绍了如果我检查"内容长度"头,是不是100%准确?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果不是,如何准确的吗?
If not, how accurate is it?
我想知道图像的大小之前,我下载。
I want to know the size of the image before I download it.
推荐答案
这最好是 - ?不然为什么有它在所有
It had better be - otherwise why have it at all?
如果它不能可靠在先进确定的,它不应该由服务器在所有服务。 (当处理动态生成的文本处理,例如,像分块可以使用的传输编码 - 这不需要最终长度时HTTP头是在流的开始写入是已知的。)
If it can't be reliably determined in advanced, it shouldn't be served by the server at all. (When dealing with dynamically generated text, for example, something like chunked transfer encoding may be used - which doesn't require the final length to be known when the HTTP header is written at the beginning of the stream.)
这篇关于如果我检查"内容长度"头,是不是100%准确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文