304: The condition specified using HTTP conditional header(s) is not met

泪湿孤枕 提交于 2019-12-01 00:57:34

问题


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”

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.

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

Thanks Steve


回答1:


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

HTTP status code 304 is defined as "Not Modified" (see http://www.w3.org/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.

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

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.



来源:https://stackoverflow.com/questions/6112520/304-the-condition-specified-using-http-conditional-headers-is-not-met

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!