为什么304状态代码计为“重定向?”? [英] Why does the 304 status code count as a "redirect?"

查看:1651
本文介绍了为什么304状态代码计为“重定向?”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试了解304 / Not修改的确切条件是否符合3xx范围的HTTP状态代码类。 RFC 1945,sec。 9.3 RFC 2616,sec。 10.3 都读:

I am currently trying to understand how exactly 304/Not modified qualifies for the 3xx-range class of HTTP status codes. RFC 1945, sec. 9.3 and RFC 2616, sec. 10.3 both read:


此类状态代码表示用户代理需要采取进一步的操作,以便履行请求。

This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request.

虽然从客户端的本地缓存加载显然是进一步行动,但我很难看到这是HTTP意义上的重定向。我是按字面意思读这个吗?

While "loading from the client's local cache" clearly is a "further action," I am struggling to see how this is a redirect in the sense of HTTP. Am I reading this too literally?

推荐答案

参见 http://greenbytes.de/tech/webdav/draft-ietf-httpbis-p2-semantics-26.html #rfc.section.6.4.p.2

有几种类型的重定向:


  1. 指示资源可能位于不同URI的重定向,如位置字段所提供的,如状态代码301(永久移动),302(找到)和307 (临时重定向)。

  1. Redirects that indicate the resource might be available at a different URI, as provided by the Location field, as in the status codes 301 (Moved Permanently), 302 (Found), and 307 (Temporary Redirect).

重定向,提供匹配资源选择,每个资源都能够表示原始请求目标,如300(多重选择)状态代码。

Redirection that offers a choice of matching resources, each capable of representing the original request target, as in the 300 (Multiple Choices) status code.

重定向到由Location字段标识的不同资源,可以表示对请求的间接响应,如303(请参阅其他)状态码。

Redirection to a different resource, identified by the Location field, that can represent an indirect response to the request, as in the 303 (See Other) status code.

重定向到之前的cac结果,如304(未修改)状态代码。

Redirection to a previously cached result, as in the 304 (Not Modified) status code.

这篇关于为什么304状态代码计为“重定向?”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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