HTTP 206 Partial Content 状态消息是什么意思,我该如何完全加载资源? [英] What does the HTTP 206 Partial Content status message mean and how do I fully load resources?

查看:45
本文介绍了HTTP 206 Partial Content 状态消息是什么意思,我该如何完全加载资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这样的网站上有一些图片标签.

I have some image tags on a site like this.

<img src="img.png"/>

当我尝试加载它们时,它们只加载了一半.当我检查网络控制台中的请求时,我看到响应是:

When I try to load them they are only half loading. When I checked the request in the network console I see that the response is:

206 部分内容

我用谷歌搜索它,它说如果在标题中设置了一个范围,它将是这样的.但是这些标头实际上在哪里设置?以及如何避免这种情况并加载完整图像?

I googled it and it says that if there is a range set in header, it will be like this. But where are these headers actually set? And how do I avoid this and load the full images?

推荐答案

From user166390's answer 到问题为什么 Firebug 显示"206 部分内容"对视频加载请求的响应?

当客户端请求一个范围(例如给我第一个 2MB 视频数据")时,此部分内容代码 (206) 可以从服务器发送.

This Partial Content code (206) may be sent from the server when the client has asked for a range (e.g. "give me the first 2MB of video data").

分块下载数据以避免获取未使用的资源至关重要.(我很少在线观看完整的视频.)查看对 Range 标头的传出请求.

It is vital for downloading data in chunks which avoids fetching unused resources. (I seldom watch a full video online.) Look at the outgoing request for a Range header.

这篇关于HTTP 206 Partial Content 状态消息是什么意思,我该如何完全加载资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆