304:不满足使用HTTP条件标头指定的条件

编程入门 行业动态 更新时间:2024-10-11 19:15:54
本文介绍了304:不满足使用HTTP条件标头指定的条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我当前正在将文件存储在Azure Blob存储中,当我请求文件时,我在firebug中收到一条消息304不满足使用HTTP条件标头指定的条件"

I'm currently storing files within Azure Blob Storage and when I request the files I get an message in firebug of 304 "The condition specified using HTTP conditional header(s) is not met"

我查看了 Azure Blob:不满足使用HTTP条件标头指定的条件" 及其类似的问题,但我没有使用blob.openread等读取内容...我只是在尝试在浏览器中查看内容.

I've looked at Azure Blob: "The condition specified using HTTP conditional header(s) is not met" and its a similar question but I'm not reading the content in using blob.openread etc... I'm just trying to view the content in a browser.

如果我在firefox中进行控件刷新(ctrl和f5),则会收到200的响应-因此可以正确使用它.我已经在要返回的文件上设置了缓存控件(最大年龄= 3600,公共),但仍然收到此错误/通知.

If I do a control refresh (ctrl and f5) in firefox I get a response of 200 - so its being served out correctly. I've set the cache control (max-age=3600, public) on the file I'm returning but yet I still get this error / notification.

我的问题是,当我请求通过此回复返回的内容时,我应该担心吗?

My question is, should I be worried that when I request the content that its coming back with this response?

任何建议/想法都会得到大家的认可

Any advice / thoughts you have will be greatly received

谢谢 史蒂夫

推荐答案

如果自您的浏览器上次访问内容以来,Blob存储中的内容没有更改,则这是正确的行为.

If the content in Blob Storage hasn't changed since your browser last accessed the content then this is the correct behaviour.

HTTP状态代码304被定义为未修改"(请参见 www.w3/Protocols/rfc2616/rfc2616-sec10.html ).我可以预料的是,您的浏览器已将上次接收到的ETag与内容一起发送到HTTP If-None-Match标头中的Blob存储,并且由于该ETag仍与与存储中的内容相关联的ETag匹配,因此无需通过电线发送新版本.

HTTP status code 304 is defined as "Not Modified" (see www.w3/Protocols/rfc2616/rfc2616-sec10.html). What I would anticipate is that your browser has sent the ETag which it last received with the content to Blob Storage in the HTTP If-None-Match header, and as this ETag still matches the ETag associated with the content in storage there's no need to send a new version down the wire.

此处提供有关ETag的更多信息: en.wikipedia/wiki/HTTP_ETag .您可以通过Fiddler看到这种行为.

More on ETags here: en.wikipedia/wiki/HTTP_ETag. You can see this behaviour in action through Fiddler.

FireFox Ctrl-F5显式强制刷新,这意味着不发送If-None-Match标头.因此,Blob存储通过网络发送图像的新副本.

The FireFox Ctrl-F5 explicitly forces a refresh, which means that no If-None-Match header is sent. Blob Storage therefore sends a fresh copy of the image down the wire.

更多推荐

304:不满足使用HTTP条件标头指定的条件

本文发布于:2023-10-28 01:22:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535083.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:条件   不满足   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!