HTTP

yzw469885313 2013-03-13 10:42:09
If-Range、Range、Etag与分片请求之间的关联
以下是从HTTP pocket reference 中摘取的一段对Etag的描述:
Entity tags are unique identifiers that can be associated with all copies of the document. If the document changes, the entity tag changes—so it is more efficient to check for the entity tag, not for the URL and Last-Modified date.
If the server uses entity tags, it sends the document with the ETag header. When the client wants to verify if a document matches a particular entity tag, it uses the If-Match or If-None-Match header.
If-Range、Range、Etag的格式:
ETag: "38a88-e35f-4ce92b222513c"
If-Range:"38a88-e35f-4ce92b222513c"
Range: bytes=0-4095
在向服务器申请range类型数据时,需要和If-Range搭配使用,如果If-Range匹配上,那么客户端已经存在的部分是有效的,服务器将返回客户端缺失部分,即Range里指定的字节范围,然后返回206(partial content),否则证明客户端的部分已无效(可能已经更改),那么服务器将整个实体的内容全部返回给客户端,同时返回200 OK.
The If-Range header can use either a last modified date or an entity tag to verify that the document is still the same.
...全文
38 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧