gzip chunked

--=比天空间=-- - mod_gzip和chunked

http://www.httpwatch.com/httpgallery/chunked/

When an HTTP client is reading a response message from a server it needs to know when it has reached the end of the message. This is particularly important with persistent (keep alive) connections, because a connection can only be re-used by another HTTP transaction after the response message has been fully received. The following sections describe the four ways in which an HTTP server can indicate the end of the response message:

9.1 Connection Closed by Server

The connection can be closed at the end of the response message by the server, but this prevents connections being re-used.

9.2 Content-Length Header

The length of the content after the response headers can be specified in bytes with the Content-Length header

9.3 Implied Content Length

Some types of responses, such as 304, are defined to never have content and therefore the client can assume that the response message is terminated by the double CRLF after the headers.

9.4 Chunked Encoding

The content can be broken up into a number of chunks; each of which is prefixed by its size in bytes. A zero size chunk indicates the end of the response message. If a server is using chunked encoding it must set the Transfer-Encoding header to "chunked".

Chunked encoding is useful when a large amount of data is being returned to the client and the total size of the response may not be known until the request has been fully processed. An example of this is generating an HTML table of results from a database query. If you wanted to use the Content-Length header you would have to buffer the whole result set before calculating the total content size. However, with chunked encoding you could just write the data one row at a time and write a zero sized chunk when the end of the query was reached.

posted on 2012-03-02 15:29 lexus 阅读(...) 评论(...) 编辑 收藏

转载于:https://www.cnblogs.com/lexus/archive/2012/03/02/2377285.html

gzip chunked相关推荐

  1. gzip+chunked页面分段输出,resin gzip trunked无效,页面数据写入自定义buffer

    伸手党请绕路! 首先普及知识: gzip:一种web常见的压缩格式,压缩率大致50%,能极大降低带宽占用量,gzip 格式: 10字节首部+数据部分+8字节尾部. chrunked:http1.1功能 ...

  2. HTML中chunked解码和gzip解压

    chunked编码 chunked编码的的好处 当访问的时动态页面时,服务器则无法预知内容的大小,因此需要一遍产生数据,一边发送数据,将数据分块发送(服务器通过响应头'Transfer-Encodin ...

  3. http chunked

    问题 这几天在对接协议的时候发现对接服务器所给的回复有些奇怪,http头中没有Content-Length字段,仔细看了下返回的数据,其中多了Transfer-Encoding: chunked字段, ...

  4. 腾讯 Node.js 基础设施 Tencent Server Web 正式开源

    开发四年只会写业务代码,分布式高并发都不会还做程序员? >>>   经过六年的迭代与沉淀,腾讯Tencent Server Web (以下简称TSW)这一公司级运维组件于今日正式开源 ...

  5. 腾讯Node.js基础设施TSW正式开源

    经过六年的迭代与沉淀,腾讯Tencent Server Web (以下简称TSW)这一公司级运维组件于今日正式开源.TSW是面向WEB前端开发者,以提升问题定位效率为初衷,提供云抓包.全息日志和异常发 ...

  6. HTTP 响应的分块传输

    Transfer-Encoding 响应头用于告诉客户端服务器发送内容的编码格式. 其可选值有: chunked:数据分块发送.此时应缺省 Content-Length 响应头. compress:使 ...

  7. date字段 http 头文件_HTTP头文件获取

    HTTP_ALL得到以下全部 HTTP_CACHE_CONTROL:no-cache HTTP_CONNECTION:Keep-Alive, TE HTTP_ACCEPT:text/html, app ...

  8. HTTP/1.1(消息格式、连接管理、条件请求、范围请求、缓存、身份验证)

    文章目录 概述 消息格式 开始行 请求方法 请求目标 状态码 头部字段 消息体 连接管理 条件请求(Conditional Requests) 范围请求(Range Requests) 缓存(Cach ...

  9. 一些可以参考的文档集合9

    之前的文章集合: 一些可以参考文章集合1_xuejianxinokok的博客-CSDN博客 一些可以参考文章集合2_xuejianxinokok的博客-CSDN博客 一些可以参考的文档集合3_xuej ...

最新文章

  1. 理解ffmpeg中的pts,dts,time_base
  2. java恶作剧小程序_一个Java恶搞小程序
  3. 正则判断 空格_js关于正则的前后关联约束(前后预查)
  4. c函数sscanf的高级技巧
  5. 计算机硬盘不识别u盘启动,快启动U盘启动pe系统无法识别硬盘怎么办?
  6. css相关笔记(一)
  7. UnderWater+SDN论文之六
  8. 微信也QQ服务器,妄想山海QQ区还是微信区好 平民服务器选择推荐
  9. nbu备份脚本 linux,NBU60网络备份大全之Linux设备管理(参考Word)
  10. CODEBLOCKS 汉化配置
  11. 计算机网络英语app,在斑马英语app的详细软件功能介绍
  12. 小程序 背景图 repeat_小魔女诺贝3D射击/中文 | 电脑游戏
  13. 多项创新功能驱动,Galaxy S9必将引爆2018智能手机市场
  14. windows 7 浏览器无法进网站,提示安全证书存在问题(GlobalSign)
  15. 使用VSCode创建一个Vue项目
  16. GameofMir引擎架设传奇服务器【1:架设服务端】
  17. 海思hi3519a的MIPI用法
  18. 最活跃的FPGA论坛
  19. 【最新】2021自动化测试面试宝典1000题
  20. 索尼电视linux系统版本,索尼X9500H智能液晶4K电视加入最新安卓9.0操作系统

热门文章

  1. sldprt文件用什么软件打开(手机sldprt文件查看器)
  2. WIN7设置wifi热点的方法
  3. 详解FOF基金的四种运作模式
  4. 年轻人,你需要懂得 6 条成长规则
  5. RT-Thread 基于QSPI驱动LY68L6400-SRAM
  6. 南开大学计算机学院 肖嘉文,南开大学计算机学院导师教师师资介绍简介-任明明...
  7. [C++程序设计](入门级题解)计数问题
  8. Android 手机配office365邮箱
  9. 加入昇思MindFlow SIG,助力AI流体仿真发展
  10. 74LS161(两个)驱动数码管显示两位十六进制数