笑一笑,十年少

然付诸行动者少


  • 首页

  • 标签

  • 搜索

streaming=True 之后发生了什么❓

发表于 April 21, 2017, 1:23 p.m.   |   分类于 稍微正经点的   |   阅读次数

参考链接:https://gist.github.com/CMCDragonkai/6bfade6431e9ffb7fe88

好处:

  • the receiver can act on the data stream in chunks immediately instead of waiting for the entire data to arrive

疑问:

  • http request 的 body 没有被读的时候,这些内容在哪个地方呢?在网线上?还是被系统缓存起来了?还是在 Nginx 什么之类的?

Content-Length header determines the byte length of the request/response body. If you neglect to specify the Content-Length header, HTTP servers will implicitly add a Transfer-Encoding: chunked header. (they should not be used together)

The Content-Length header will not allow streaming, but it is useful for large binary files, where you want to support partial content serving.

一点基础知识:一个连接过来传到 Nginx,当这个连接发送的数据足够多或者关闭时,Nginx 才会把东西继续往下传。

所以,streaming 其实就是用了 Chunked transfer encoding 这个东西。噗

#http streaming #file upload
上一篇博客
  • 文章目录
  • 站点概览
cosven

cosven

个人喜欢 Python 编程语言,平时喜欢学习 Web 开发、编程语言方面的知识,同时在积极扎实计算机基础,目前工作岗位是运维(DevOps)开发。

65 日志
4 分类
106 标签
RSS
GitHub 豆瓣 知乎
theme port from NexT