RFC7232: Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests

Table of Contents

View Repo RFC7232: Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests - 图1 RFC7232: Hypertext Transfer Protocol (HTTP/1.1): Conditional Requests - 图2

  1. PROPOSED STANDARD
  2. Errata Exist
  3. Internet Engineering Task Force (IETF) R. Fielding, Ed.
  4. Request for Comments: 7232 Adobe
  5. Obsoletes: 2616 J. Reschke, Ed.
  6. Category: Standards Track greenbytes
  7. ISSN: 2070-1721 June 2014

摘要 / Abstract

The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document defines HTTP/1.1 conditional requests, including metadata header fields for indicating state changes, request header fields for making preconditions on such state, and rules for constructing the responses to a conditional request when one or more preconditions evaluate to false.

超文本传输协议(HTTP)是一种无状态stateless的应用层协议,适用于分布式、协作式的超文本信息系统。本文档定义了 HTTP/1.1 条件请求,包括:元数据头字段metadata header fields——用于表明状态的改变、请求头字段request header fields——用于对这些状态设置前提条件、以及规则rules——用于当一个或多个前提条件求值结果为false的时候构造响应给条件请求。

备忘状态 / Status of This Memo

This is an Internet Standards Track document.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc7232.

Copyright Notice

Copyright © 2014 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

This document may contain material from IETF Documents or IETF Contributions published or made publicly available before November 10, 2008. The person(s) controlling the copyright in some of this material may not have granted the IETF Trust the right to allow modifications of such material outside the IETF Standards Process. Without obtaining an adequate license from the person(s) controlling the copyright in such materials, this document may not be modified outside the IETF Standards Process, and derivative works of it may not be created outside the IETF Standards Process, except to format it for publication as an RFC or to translate it into languages other than English.

1. 引言 / Introduction

Conditional requests are HTTP requests [RFC7231] that include one or more header fields indicating a precondition to be tested before applying the method semantics to the target resource. This document defines the HTTP/1.1 conditional request mechanisms in terms of the architecture, syntax notation, and conformance criteria defined in [RFC7230].

条件请求conditional requests是这样一种 HTTP 请求【RFC7231】,它包含了一个或多个头字段来表明一种前提条件precondition,这种前提条件需要在将方法语义应用到目标资源之前进行测试。本文档依据【RFC7230】所定义的架构、句法标记、以及一致性准则,来定义 HTTP/1.1 条件请求的机制。

Conditional GET requests are the most efficient mechanism for HTTP cache updates [RFC7234]. Conditionals can also be applied to state-changing methods, such as PUT and DELETE, to prevent the "lost update" problem: one client accidentally overwriting the work of another client that has been acting in parallel.

对于 HTTP 缓存更新【RFC7234】来说,条件 GET 请求是最有效的。条件请求也可以被应用到状态改变的方法state-changing methods中,比如 PUT 和 DELETE,来预防“丢失更新lost update”问题——在并行处理的环境中,一个客户端意外地覆盖overwriting了另一个客户端的处理结果。

Conditional request preconditions are based on the state of the target resource as a whole (its current value set) or the state as observed in a previously obtained representation (one value in that set). A resource might have multiple current representations, each with its own observable state. The conditional request mechanisms assume that the mapping of requests to a "selected representation" (Section 3 of [RFC7231]) will be consistent over time if the server intends to take advantage of conditionals. Regardless, if the mapping is inconsistent and the server is unable to select the appropriate representation, then no harm will result when the precondition evaluates to false.

总的来说,条件请求的前提条件是基于目标资源的状态(目标资源的当前值current value的集合),或者在之前获得的一种表示形式所观察到的状态(这个当前值集合中的其中之一)的。一个资源可以有多种当前表示形式,每个具有它自身可观察到的状态码。如果服务器打算使用条件请求,条件请求的机制会假定请求与一种“已选表示形式selected representation”(【RFC7231】章节 3)的映射会随时间的改变而保持一致。不管怎么样,如果这种映射是不一致的,并且服务器不能够选择合适的表示形式,那么,当前提条件的求值结果为假(即条件不成立)的时候,最终结果应该要是无害的。

The conditional request preconditions defined by this specification (Section 3) are evaluated when applicable to the recipient (Section 5) according to their order of precedence (Section 6).

由本规范所定义的条件请求的前提条件(章节 3)会在应用到接收端的时候进行求值(章节 5),依据它们的优先级顺序(章节 6)。

1.1. 一致性和错误处理 / Conformance and Error Handling

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文档中的关键词 必须MUST禁止MUST NOT要求REQUIRED必须SHALL禁止SHALL NOT应当SHOULD不应当SHOULD NOT推荐RECOMMENDED可以MAY可选OPTIONAL 的意义与【RFC2119】一致。

Conformance criteria and considerations regarding error handling are defined in Section 2.5 of [RFC7230].

关于错误处理的一致性标准以及注意事项已在【RFC7230】章节 2.5 中定义了。

1.2. 句法标记 / Syntax Notation

This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234] with a list extension, defined in Section 7 of [RFC7230], that allows for compact definition of comma-separated lists using a '#' operator (similar to how the '*' operator indicates repetition). Appendix B describes rules imported from other documents. Appendix C shows the collected grammar with all list operators expanded to standard ABNF notation.

本规范使用了扩展巴科斯范式(ABNF)标记法【RFC5234】,另外,出于定义的紧凑性的考虑,本规范对 ABNF 规则进行了扩展(见【RFC7230】章节 7),允许使用一个 # 操作符(类似于 * 操作符,指代“重复”)来定义一种以逗号分隔的列表。附录 B 描述了引进自其他文档的规则。附录 C 展示了所有已收集的包含列表扩展规则以及标准 ABNF 标记的语法。

2. 验证器 / Validators

This specification defines two forms of metadata that are commonly used to observe resource state and test for preconditions: modification dates (Section 2.2) and opaque entity tags (Section 2.3). Additional metadata that reflects resource state has been defined by various extensions of HTTP, such as Web Distributed Authoring and Versioning (WebDAV, [RFC4918]), that are beyond the scope of this specification. A resource metadata value is referred to as a "validator" when it is used within a precondition.

本规范定义了两类元数据:修改日期modification dates章节 2.2)和不透明实体标签opaque entity tags章节 2.3),它们常用于观察资源的状态以及对前提条件进行测试。其他额外的反映资源状态的元数据定义在各种 HTTP 扩展当中,比如 Web 分布式创作和版本管理Web Distributed Authoring and Versioning(WebDAV,【RFC4918】),超出了本规范的范畴。资源元数据resource metadata的值使用在一个前提条件precondition中的时候,它被称为“验证器validator”。

译注:可以先将验证器理解为是一种头字段,以方便理解下文。

2.1. 弱与强 / Weak versus Strong

Validators come in two flavors: strong or weak. Weak validators are easy to generate but are far less useful for comparisons. Strong validators are ideal for comparisons but can be very difficult (and occasionally impossible) to generate efficiently. Rather than impose that all forms of resource adhere to the same strength of validator, HTTP exposes the type of validator in use and imposes restrictions on when weak validators can be used as preconditions.

验证器validator分成两类:强验证和弱验证。弱验证器weak validators容易生成,但对于对比comparisons来说几乎没有什么用处。强验证器strong validators是理想的对比方式,但它很难有效地生成(有时甚至不可能生成)。与其强制资源的所有形式都附带相同的验证器类型,HTTP 显露出使用中的验证器的类型并对“什么时候弱验证器可以用作前提条件”施加限制。

A "strong validator" is representation metadata that changes value whenever a change occurs to the representation data that would be observable in the payload body of a 200 (OK) response to GET.

强验证器strong validator是这样一种表示形式元数据representation metadata:每当对应的表示形式数据representation data的发生变化的时候,它们的值同样会作出改变。这种变化可以在回应给 GET 的 200 (OK) 响应的有效载荷里观察到。

A strong validator might change for reasons other than a change to the representation data, such as when a semantically significant part of the representation metadata is changed (e.g., Content-Type), but it is in the best interests of the origin server to only change the value when it is necessary to invalidate the stored responses held by remote caches and authoring tools.

除了表示形式数据发生变化以外,强验证器还可能因为其他原因而发生改变,比如表示形式元数据中语义上的重要组成部分(例如 Content-Type)发生了变化,然而,当有必要让已存储在远程缓存服务器remote caches或者创作工具authoring tools里的响应置为失效invalidate的时候,仅改变它的值是最符合源服务器的最大利益的。

Cache entries might persist for arbitrarily long periods, regardless of expiration times. Thus, a cache might attempt to validate an entry using a validator that it obtained in the distant past. A strong validator is unique across all versions of all representations associated with a particular resource over time. However, there is no implication of uniqueness across representations of different resources (i.e., the same strong validator might be in use for representations of multiple resources at the same time and does not imply that those representations are equivalent).

缓存服务器里的条目可能持续存储到任意长的时间周期中,而不管它的过期时间。这样,缓存服务器可能会试图对它很久以前就获得的条目使用验证器来进行验证。对于一个特定资源相关的所有表示形式的所有版本,不管什么时候强验证器都是唯一的。然而,不同资源的表示形式没有唯一的实现(也就是说,同一个强验证器可能会同时用在多个资源的表示形式中,而且这并不意味着这些表示形式是等价的)。

译注:再说明一下,对于同一个资源,它的所有表示形式的所有版本的 ETag 都是不相同,即它们都是唯一的。但是,不能保证不同资源所使用的 ETag 是唯一的,即它们可能有相同的值。

There are a variety of strong validators used in practice. The best are based on strict revision control, wherein each change to a representation always results in a unique node name and revision identifier being assigned before the representation is made accessible to GET. A collision-resistant hash function applied to the representation data is also sufficient if the data is available prior to the response header fields being sent and the digest does not need to be recalculated every time a validation request is received. However, if a resource has distinct representations that differ only in their metadata, such as might occur with content negotiation over media types that happen to share the same data format, then the origin server needs to incorporate additional information in the [strong] validator to distinguish those representations.

实践中使用了各种各样的强验证器。最好的方式是基于严格的版本控制strict revision control,在让 GET 访问之前,对其内的每一个表示形式的每一次修改总是会得到一个唯一的记录节点和版本标识符。要在将要发送响应头字段之前表示形式数据的数据就可使用并且在每次接收到一个验证请求时并不需要重新计算摘要的充分条件是对这份数据应用冲突保护collision-resistant散列方法hash function。但是,如果资源的某些表示形式的区别只在于它们的元数据的话,比如可能发生在忽略媒体类型的内容协商导致共享了相同的数据格式的情况,那么,源服务器需要在强验证器内加入额外的信息来区分这些表示形式。

译注:本段有勘误,见 Errata #5236

In contrast, a "weak validator" is representation metadata that might not change for every change to the representation data. This weakness might be due to limitations in how the value is calculated, such as clock resolution, an inability to ensure uniqueness for all possible representations of the resource, or a desire of the resource owner to group representations by some self-determined set of equivalency rather than unique sequences of data. An origin server SHOULD change a weak entity-tag whenever it considers prior representations to be unacceptable as a substitute for the current representation. In other words, a weak entity-tag ought to change whenever the origin server wants caches to invalidate old responses.

作为对比,弱验证器weak validator是这样一种表示形式元数据representation metadata:对应的表示形式数据每次发生变化的时候,它们的值并不一定会跟随改变。造成这种弱关系的原因可能是:由于计算它的值时的限制,比如时间精度clock resolution,无法保证一个资源所有可能的表示形式的唯一性;或者由于资源所有者希望通过某些自主决定的等价规则而不是依据数据序列的唯一性,来对表示形式进行归纳。无论何时,一旦源服务器认为之前的那些表示形式不再能作为当前表示形式的替代的时候,它 应当 改变弱实体标签weak entity-tag的值。换句话说,无论何时,一旦源服务器希望缓存服务器将旧的响应置为失效invalidate的时候,弱实体标签应该被改变。

For example, the representation of a weather report that changes in content every second, based on dynamic measurements, might be grouped into sets of equivalent representations (from the origin server's perspective) with the same weak validator in order to allow cached representations to be valid for a reasonable period of time (perhaps adjusted dynamically based on server load or weather quality). Likewise, a representation's modification time, if defined with only one-second resolution, might be a weak validator if it is possible for the representation to be modified twice during a single second and retrieved between those modifications.

例如,基于动态的天气数据测量,天气报告的表示形式的内容在每一秒都会发生变化,但为了让已缓存的表示形式能够在一个合理的时间周期(这个时间周期可能基于服务器的负载或者天气质量而动态地调整)内仍然有效,可能会使用同一个弱验证器来将这些新产生的表示形式归纳到一系列等价的表示形式里(所谓等价是从源服务器的观点来看)。同样,一个表示形式的修改时间,如果仅仅使用时间精度为一秒来定义的话,而且如果这个表示形式有可能在一秒钟之内被修改两次并在这两次修改之间被请求获取,那么,它可能就是一个弱验证器。

Likewise, a validator is weak if it is shared by two or more representations of a given resource at the same time, even if those representations have identical representation data. For example, if the origin server sends the same validator for a representation with a gzip content coding applied as it does for a representation with no content coding, then that validator is weak. However, two simultaneous representations might share the same strong validator if they differ only in the representation metadata, such as when two different media types are available for the same representation data.

同样,如果一个验证器在同一时间内被一个给定资源的两个或以上表示形式所共享,即使这些表示形式有相同的表示形式数据representation data,那么,这个验证器是弱类型的。例如,如果源服务器对于某个资源的一种应用过 gzip 内容编码的表示形式以及一种未应用任何内容编码的表示形式发送的都是相同的验证器,那么,可以确定这个验证器是弱类型的。但是,两个同时生成的表示形式可能共享相同的强验证器,如果它们的区别仅在于表示形式元数据,比如当两个不同的媒体类型都可用于同一份表示形式数据。

译注:本段有勘误,见 Errata #5236

Strong validators are usable for all conditional requests, including cache validation, partial content ranges, and "lost update" avoidance. Weak validators are only usable when the client does not require exact equality with previously obtained representation data, such as when validating a cache entry or limiting a web traversal to recent changes.

强验证器可使用于所有条件请求中,包括:缓存验证、部分内容范围、以及避免“丢失更新”。弱验证器仅能用于当客户端并不要求与之前所获得的表示形式数据完全相等的情况,比如当验证一个缓存条目或者限制一个网页遍历到最近的变更的情况。

2.2. Last-Modified

The "Last-Modified" header field in a response provides a timestamp indicating the date and time at which the origin server believes the selected representation was last modified, as determined at the conclusion of handling the request.

响应里的 Last-Modified 头字段提供了一个时间戳,这个时间戳是指:源服务器认为这个已选择的表示形式selected representation最后一次被修改的日期和时间。这个头字段是在请求处理结束时所确定的。

  1. Last-Modified = HTTP-date

An example of its use is

使用它的一个例子:

  1. Last-Modified: Tue, 15 Nov 1994 12:45:26 GMT

2.2.1. 生成 / Generation

An origin server SHOULD send Last-Modified for any selected representation for which a last modification date can be reasonably and consistently determined, since its use in conditional requests and evaluating cache freshness ([RFC7234]) results in a substantial reduction of HTTP traffic on the Internet and can be a significant factor in improving service scalability and reliability.

对于能够合理和统一确定最后修改日期的所有已选定表示形式,源服务器都 应当 发送 Last-Modified,这是因为这个头字段会用于条件请求中去对缓存的新鲜度freshness进行求值(【RFC7234】),从而降低接下来在互联网的 HTTP 流量成本,同时,它还是提升服务的伸缩性scalability可靠性reliability的一个重要的因素。

A representation is typically the sum of many parts behind the resource interface. The last-modified time would usually be the most recent time that any of those parts were changed. How that value is determined for any given resource is an implementation detail beyond the scope of this specification. What matters to HTTP is how recipients of the Last-Modified header field can use its value to make conditional requests and test the validity of locally cached responses.

一个表示形式通常是由资源接口背后的许多部分组成的。最后修改时间一般是所有这些组成部分中最近一次出现改变的时间。如何为任意给定的资源来确定这个值,那是实现上的细节,已超出了本规范的范畴。HTTP 所关心的是 Last-Modified 头字段的接收端如何使用它的值来进行条件请求,以及测试本地缓存的响应的有效性validity

An origin server SHOULD obtain the Last-Modified value of the representation as close as possible to the time that it generates the Date field value for its response. This allows a recipient to make an accurate assessment of the representation's modification time, especially if the representation changes near the time that the response is generated.

源服务器 应当 尽可能获取靠近它在响应里生成的 Date 字段的时间来作为表示形式representationLast-Modified 的值。这样,接收端就可以对表示形式的修改时间进行精确的评估,特别是如果表示形式在临近生成响应的时候又出现了变化。

An origin server with a clock MUST NOT send a Last-Modified date that is later than the server's time of message origination (Date). If the last modification time is derived from implementation-specific metadata that evaluates to some time in the future, according to the origin server's clock, then the origin server MUST replace that value with the message origination date. This prevents a future modification date from having an adverse impact on cache validation.

具备时钟功能的源服务器 禁止 发送一个比消息诞生origination的服务器时间(Date)还要晚的 Last-Modified 日期(译注:也就是说,响应里的 Last-Modified 字段的时间必须早于或等于 Date 字段的时间)。如果这个表示形式的最近修改的时间是源自实现专用implementation-specific的元数据,而这些元数据依据源服务器的时钟计算得出最近修改时间是在将来某个时间,那么源服务器 必须 使用消息诞生日期message origination date来替换这个值。这样做避免了一个将来的修改日期对缓存的验证的不利影响。

An origin server without a clock MUST NOT assign Last-Modified values to a response unless these values were associated with the resource by some other system or user with a reliable clock.

不具备时钟功能的源服务器 禁止 分配 Last-Modified 值到一个响应里,除非这些值是由某些具有可靠时钟功能的其他系统或用户关联到资源上的。

2.2.2. 对比 / Comparison

A Last-Modified time, when used as a validator in a request, is implicitly weak unless it is possible to deduce that it is strong, using the following rules:

  • The validator is being compared by an origin server to the actual current validator for the representation and,
  • That origin server reliably knows that the associated representation did not change twice during the second covered by the presented validator.

or

  • The validator is about to be used by a client in an If-Modified-Since, If-Unmodified-Since, or If-Range header field, because the client has a cache entry for the associated representation, and
  • That cache entry includes a Date value, which gives the time when the origin server sent the original response, and
  • The presented Last-Modified time is at least 60 seconds before the Date value.

or

  • The validator is being compared by an intermediate cache to the validator stored in its cache entry for the representation, and
  • That cache entry includes a Date value, which gives the time when the origin server sent the original response, and
  • The presented Last-Modified time is at least 60 seconds before the Date value.

当一个 Last-Modified 的时间用作一个请求里一个验证器的时候,这种使用方式暗示这个 Last-Modified 是弱验证类型,除非使用以下规则可以推断出它是强验证类型:

  • 源服务器会将这个验证器与表示形式的当前真实的验证器actual current validator进行对比,并且
  • 源服务器可靠了解相关联的表示形式,在第二次适用这个在请求里出现的验证器期间(译注:也就是说,在源服务器通过了这次验证让客户端再次使用缓存的这段时间里),这些表示形式并不会被二次改变。

译注:上述“这个验证器”指的是请求里带过来的 Last-Modified,之所以请求里会有这个字段,是因为在之前响应里,源服务器已经向客户端提供了这个资源表示形式的 Last-Modified。换句话说,这个请求已经是第二次(或以上)向源服务器请求同一个资源了。

或者:

  • 这个验证器即将被客户端用于 If-Modified-SinceIf-Unmodified-Since、或者 If-Range 头字段里,因为这个客户端有相关联的表示形式的缓存条目,并且
  • 这个缓存条目包含了一个 Date 值,给出了源服务器在什么时间发送这个原始响应,并且
  • 请求里出现的 Last-Modified 时间至少比这个 Date 值早 60 秒以上。

或者:

  • 这个验证器会被一个中间人缓存服务器与存储在它的缓存条目中的对应的表示形式的验证器进行对比,并且
  • 这个缓存条目包含了一个 Date 值,给出了源服务器在什么时间发送这个原始响应,并且
  • 请求里出现的 Last-Modified 时间至少比这个 Date 值早 60 秒以上。

This method relies on the fact that if two different responses were sent by the origin server during the same second, but both had the same Last-Modified time, then at least one of those responses would have a Date value equal to its Last-Modified time. The arbitrary 60-second limit guards against the possibility that the Date and Last-Modified values are generated from different clocks or at somewhat different times during the preparation of the response. An implementation MAY use a value larger than 60 seconds, if it is believed that 60 seconds is too short.

上述这种方法是依赖于一个事实:如果两个不同的响应被源服务器在同一秒内发送,且两者都有相同的 Last-Modified 时间,那么,这些响应中至少有一个响应会带有其值与 Last-Modified 的时间相同的 Date 字段。这个随意设定的 60 秒限制是为了防止出现以下可能:DateLast-Modified 的值是生成自不同的时钟,或者响应的准备时长有一点不同。如果实现implementation认为 60 秒太短的话,它 可以 使用大于 60 秒的值。

2.3. ETag

The "ETag" header field in a response provides the current entity-tag for the selected representation, as determined at the conclusion of handling the request. An entity-tag is an opaque validator for differentiating between multiple representations of the same resource, regardless of whether those multiple representations are due to resource state changes over time, content negotiation resulting in multiple representations being valid at the same time, or both. An entity-tag consists of an opaque quoted string, possibly prefixed by a weakness indicator.

响应中的 ETag 头字段提供了已选表示形式当前的实体标签entity-tag,这个头字段是在请求处理结束时所确定的。实体标签是一种不透明的验证器opaque validator,以在同一个资源的不同表示形式之间进行区分,不管是由于资源状态随时间变化而产生的多个表示形式,还是内容协商的结果使同一时间内有多个合适的表示形式,还是两者都有(译注:也就是说,只要是同一个资源的表示形式,ETag 都能够进行区分,不管是以什么方式而产生的表示形式)。一个实体标签由一个不透明的以引号包裹的字符串opaque quoted string构成,可能会前置一个“弱验证”的指标符("W/")。

译注:对于不透明验证器opaque validator就是一种不透明数据opaque data,对于不透明数据的解释见【RFC7230】章节 3.2.4末尾的译注。

  1. ETag = entity-tag
  2.  
  3. entity-tag = [ weak ] opaque-tag
  4. weak = %x57.2F ; "W/", case-sensitive
  5. opaque-tag = DQUOTE *etagc DQUOTE
  6. etagc = %x21 / %x23-7E / obs-text
  7. ; VCHAR except double quotes, plus obs-text

Note: Previously, opaque-tag was defined to be a quoted-string ([RFC2616], Section 3.11); thus, some recipients might perform backslash unescaping. Servers therefore ought to avoid backslash characters in entity tags.

注意: 之前,opaque-tag 是定义为一个 quoted-string 的(【RFC2616】章节 3.11),由此,某些接收端可能会执行反斜杠的逆转义backslash unescaping。所以,服务器应该避免在实体标签内出现反斜杠字符。

An entity-tag can be more reliable for validation than a modification date in situations where it is inconvenient to store modification dates, where the one-second resolution of HTTP date values is not sufficient, or where modification dates are not consistently maintained.

在以下这些情况下,基于实体标签entity-tag的验证比修改日期modification date更加可靠:不方便保存修改日期的情况;使用时间精度为 1 秒的 HTTP 日期不能满足需求的情况;修改日期不能一直维持consistently maintained的情况。

Examples:

ETag 的例子:

  1. ETag: "xyzzy"
  2. ETag: W/"xyzzy"
  3. ETag: ""

An entity-tag can be either a weak or strong validator, with strong being the default. If an origin server provides an entity-tag for a representation and the generation of that entity-tag does not satisfy all of the characteristics of a strong validator (Section 2.1), then the origin server MUST mark the entity-tag as weak by prefixing its opaque value with "W/" (case-sensitive).

实体标签可以是一个弱验证器,也可以是一个强验证器,默认是强验证器。如果源服务器为一个表示形式提供了一个实体标签,但这个实体标签的生成并不能满足作为一个强验证器的所有特征(章节 2.1),那么,源服务器 必须 将这个实体标签标记为弱验证类型,具体是通过在它的不透明值的前面放置一个 "W/"(区分大小写)。

2.3.1. 生成 / Generation

The principle behind entity-tags is that only the service author knows the implementation of a resource well enough to select the most accurate and efficient validation mechanism for that resource, and that any such mechanism can be mapped to a simple sequence of octets for easy comparison. Since the value is opaque, there is no need for the client to be aware of how each entity-tag is constructed.

实体标签背后的原理是:只有服务创造者service author才懂得选择资源的最精确和最有效的验证机制的实现方法,而且所述的任何机制都可以映射为一组简单的字节序列来轻易对比。正因为这个值是不透明的,因此,客户端不需要了解每一个实体标签是如何构建的。

For example, a resource that has implementation-specific versioning applied to all changes might use an internal revision number, perhaps combined with a variance identifier for content negotiation, to accurately differentiate between representations. Other implementations might use a collision-resistant hash of representation content, a combination of various file attributes, or a modification timestamp that has sub-second resolution.

例如,某个实现具有实现专用implementation-specific的版本管理功能,可以对资源的对所有改变进行版本管理,那么某个资源就可以使用一个内部修订号,可能会结合一个与内容协商所不同的标识符,来精确地区分所有表示形式。其他实现可能使用表示形式内容的一个冲突保护collision-resistant散列,或者多个文件属性的结合,或者一个精度为亚秒级sub-second的修改时间戳。

An origin server SHOULD send an ETag for any selected representation for which detection of changes can be reasonably and consistently determined, since the entity-tag's use in conditional requests and evaluating cache freshness ([RFC7234]) can result in a substantial reduction of HTTP network traffic and can be a significant factor in improving service scalability and reliability.

源服务器 应当 发送一个 ETag,因为实体标签在条件请求以及缓存新鲜度评估evaluation cache freshness(【RFC7234】)上的应用能够显著降低 HTTP 网络流量成本,同时,它还是提升服务的伸缩性scalability可靠性reliability的一个重要的因素。

2.3.2. 对比 / Comparison

There are two entity-tag comparison functions, depending on whether or not the comparison context allows the use of weak validators:

  • Strong comparison: two entity-tags are equivalent if both are not weak and their opaque-tags match character-by-character.
  • Weak comparison: two entity-tags are equivalent if their opaque-tags match character-by-character, regardless of either or both being tagged as "weak".

有两种实体标签的对比方法,取决于对比场景comparison context里是否允许使用弱验证器:

  • 强对比:当两个实体标签都不是弱验证类型,并且它们的 opaque-tags 里的字符一一匹配,那么,这两个实体标签是相等的。
  • 弱对比:当两个实体标签的 opaque-tags 里的字符一一匹配,而不必理会它们之中是否有被标记为弱类型("W/"),那么,这两个实体标签是相等的。

The example below shows the results for a set of entity-tag pairs and both the weak and strong comparison function results:

下面的例子展示了一组实体标签使用弱对比方法和强对比方法的对比结果:

ETag 1 ETag 2 Strong Comparison Weak Comparison
W/"1" W/"1" no match match
W/"1" W/"2" no match no match
W/"1" "1" no match match
"1" "1" match match

2.3.3. 示例:实体标签在内容协商资源上的变化 / Example: Entity-Tags Varying on Content-Negotiated Resources

Consider a resource that is subject to content negotiation (Section 3.4 of [RFC7231]), and where the representations sent in response to a GET request vary based on the Accept-Encoding request header field (Section 5.3.4 of [RFC7231]):

假设一个资源受控于内容协商content negotiation【RFC7231】章节 3.4),在回应给一个 GET 请求的响应中,发送哪一种表示形式是基于 Accept-Encoding 请求头字段(【RFC7231】章节 5.3.4)的不同而改变:

>> Request:

>> 请求:

  1. GET /index HTTP/1.1
  2. Host: www.example.com
  3. Accept-Encoding: gzip
  4.  

In this case, the response might or might not use the gzip content coding. If it does not, the response might look like:

在这种情况,响应可能使用或不使用 gzip 内容编码。如果它不使用,那么响应可能看起来是这样的:

>> Response:

>> 响应:

  1. HTTP/1.1 200 OK
  2. Date: Fri, 26 Mar 2010 00:05:00 GMT
  3. ETag: "123-a"
  4. Content-Length: 70
  5. Vary: Accept-Encoding
  6. Content-Type: text/plain
  7.  
  8. Hello World!
  9. Hello World!
  10. Hello World!
  11. Hello World!
  12. Hello World!

An alternative representation that does use gzip content coding would be:

而使用 gzip 内容编码的表示形式可能是这样的:

>> Response:

>> 响应:

  1. HTTP/1.1 200 OK
  2. Date: Fri, 26 Mar 2010 00:05:00 GMT
  3. ETag: "123-b"
  4. Content-Length: 43
  5. Vary: Accept-Encoding
  6. Content-Type: text/plain
  7. Content-Encoding: gzip
  8.  
  9. ...binary data...

Note: Content codings are a property of the representation data, so a strong entity-tag for a content-encoded representation has to be distinct from the entity tag of an unencoded representation to prevent potential conflicts during cache updates and range requests. In contrast, transfer codings (Section 4 of [RFC7230]) apply only during message transfer and do not result in distinct entity-tags.

注意: 内容编码值content codings是表示形式数据的一种属性,因此,经内容编码过content-encoded的表示形式的强实体标签必须区别于它的未编码过unencoded的版本的强实体标签,以避免在缓存更新或范围请求range requests期间可能发生的冲突。作为对比,传输编码值(【RFC7230】章节 4)仅作用于消息传输的期间,并不会导致实体标签的不同。

2.4. 什么时候使用实体标签和最后修改日期 / When to Use Entity-Tags and Last-Modified Dates

In 200 (OK) responses to GET or HEAD, an origin server:

  • SHOULD send an entity-tag validator unless it is not feasible to generate one.
  • MAY send a weak entity-tag instead of a strong entity-tag, if performance considerations support the use of weak entity-tags, or if it is unfeasible to send a strong entity-tag.
  • SHOULD send a Last-Modified value if it is feasible to send one.

在回应给 GET 或者 HEAD 的 200 (OK) 响应中,对于服务器:

  • 应当 发送一个实体标签验证器,除非对于它来说生成一个实体标签验证器是不可行的not feasible。
  • 可以 发送一个弱验证类型的实体标签而不是强验证类型标签,如果出于性能方面的考虑支持弱验证类型的实体标签的使用,或者生成一个强验证类型的实体标签是不可行的。
  • 应当 发送一个 Last-Modified 值,如果对于它来说发送一个 Last-Modified 是可行的话。

In other words, the preferred behavior for an origin server is to send both a strong entity-tag and a Last-Modified value in successful responses to a retrieval request.

换句话说,源服务器的首选的行为是在回应给一个检索请求(译注:例如 HTTP GET 请求)的成功响应中,既发送一个强实体标签,也发送一个 Last-Modified 值。

A client:

  • MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server.
  • SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server.
  • MAY send the Last-Modified value in subrange cache validation requests (using If-Unmodified-Since) if only a Last-Modified value has been provided by an HTTP/1.0 origin server. The user agent SHOULD provide a way to disable this, in case of difficulty.
  • SHOULD send both validators in cache validation requests if both an entity-tag and a Last-Modified value have been provided by the origin server. This allows both HTTP/1.0 and HTTP/1.1 caches to respond appropriately.

对于客户端:

  • 必须 在任何缓存验证请求cache validation request中发送实体标签(使用 If-Match 或者 If-None-Match 来发送),如果源服务器已经提供了一个实体标签的话。
  • 应当 在非子范围的缓存验证请求non-subrange cache validation requests中发送 Last-Modified 值(使用 If-Modified-Since),如果源服务器只提供了一个 Last-Modified 值(译注:即没有实体标签)的话。
  • 可以 在子范围缓存验证请求subrange cache validation requests中发送 Last-Modified 值(使用 If-Unmodified-Since),如果版本为 HTTP/1.0 的源服务器只提供了一个 Last-Modified 值的话。如果用户代理有困难的话,应当 提供一种途径来禁用这种行为。
  • 应当 在缓存验证请求中将两种验证器都发送,如果源服务器既提供了一个实体标签,也提供了一个 Last-Modified 值的话。这样使得 HTTP/1.0 和 HTTP/1.1 的缓存服务器都可以恰当地响应请求。

3. 前提条件头字段 / Precondition Header Fields

This section defines the syntax and semantics of HTTP/1.1 header fields for applying preconditions on requests. Section 5 defines when the preconditions are applied. Section 6 defines the order of evaluation when more than one precondition is present.

本章节定义了用于在请求中应用前提条件precondition的 HTTP/1.1 头字段的句法和语义。章节 5 定义了前提条件会在什么时候被应用。章节 6 定义了当出现超过一种前提条件的时候它们的求值顺序。

3.1. If-Match

The "If-Match" header field makes the request method conditional on the recipient origin server either having at least one current representation of the target resource, when the field-value is "*", or having a current representation of the target resource that has an entity-tag matching a member of the list of entity-tags provided in the field-value.

If-Match 头字段使得请求方法带有条件,接收端服务器仅在满足以下条件之一时才会成功响应:

  • 当字段值为 "*" 的时候,目标资源存在至少一个当前表示形式,或者
  • 目标资源存在一个当前表示形式,这个表示形式带有一个实体标签与此字段值所列出的实体标签之一相匹配。

An origin server MUST use the strong comparison function when comparing entity-tags for If-Match (Section 2.3.2), since the client intends this precondition to prevent the method from being applied if there have been any changes to the representation data.

当源服务器对 If-Match 的实体标签进行对比的时候(章节 2.3.2),源服务器 必须 使用强对比方法,这是因为客户端打算让这个前提条件来防止本执行本方法,如果表示形式数据有任何变化的话。

  1. If-Match = "*" / 1#entity-tag

Examples:

示例:

  1. If-Match: "xyzzy"
  2. If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
  3. If-Match: *

If-Match is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agents might be acting in parallel on the same resource (i.e., to prevent the "lost update" problem). It can also be used with safe methods to abort a request if the selected representation does not match one already stored (or partially stored) from a prior request.

If-Match 经常与会状态改变state-changing的请求方法一起使用(比如:POST、PUT、DELETE),来避免当多个用户代理可能并行操作同一个资源的时候导致的意外覆盖(也就是说,避免“丢失更新”的问题)。它还可以与安全方法safe methods一起使用来中止请求,如果已选表示形式并没有匹配上一个已经(或可能已经)从之前的请求里存储的表示形式。

An origin server that receives an If-Match header field MUST evaluate the condition prior to performing the method (Section 5). If the field-value is "*", the condition is false if the origin server does not have a current representation for the target resource. If the field-value is a list of entity-tags, the condition is false if none of the listed tags match the entity-tag of the selected representation.

源服务器接收到一个 If-Match 字段时 必须 在执行对应的请求方法之前对这个条件进行求值(章节 5)。如果 If-Match 的字段值是 "*",且源服务器的目标资源没有任何一种当前表示形式,那么,这个条件的求值结果为假。如果这个字段值是一个实体标签列表,且所列出的所有标签没有任何一个匹配已选表示形式的实体标签,那么这个条件的求值结果为假。

An origin server MUST NOT perform the requested method if a received If-Match condition evaluates to false; instead, the origin server MUST respond with either a) the 412 (Precondition Failed) status code or b) one of the 2xx (Successful) status codes if the origin server has verified that a state change is being requested and the final state is already reflected in the current state of the target resource (i.e., the change requested by the user agent has already succeeded, but the user agent might not be aware of it, perhaps because the prior response was lost or a compatible change was made by some other user agent). In the latter case, the origin server MUST NOT send a validator header field in the response unless it can verify that the request is a duplicate of an immediately prior change made by the same user agent.

如果所接收到的 If-Match 条件的求值结果为假,源服务器 禁止 执行请求方法,而是,源服务器 必须 响应以下其中之一:

  • 响应 412 (Precondition Failed) 状态码,或者
  • 如果源服务器已检验出目标资源又被请求了一种状态改变,并且它的最终状态已经反映为目标资源当前状态(也就是说,用户代理所请求的改变已经成功完成了,但是用户请求可能没有意识到这个,可能是因为之前的响应已经丢失了没有成功到达用户代理,或者其他某些用户代理也对目标资源请求了一种与之兼容的变化),那么,响应 2xx (Successful) 状态码的其中之一。

对于第二种情况,源服务器 禁止 在响应里发送验证器头字段,除非它能够检验出这个请求与它的同一个用户代理所造成的前一个相邻的变化相重复。

The If-Match header field can be ignored by caches and intermediaries because it is not applicable to a stored response.

If-Match 头字段可以被缓存服务器以及中间人所忽略,因为它并不适用于一个已存储的响应。

3.2. If-None-Match

The "If-None-Match" header field makes the request method conditional on a recipient cache or origin server either not having any current representation of the target resource, when the field-value is "*", or having a selected representation with an entity-tag that does not match any of those listed in the field-value.

If-None-Match 头字段使得请求方法带有条件,接收端缓存服务器或源服务器仅在满足以下条件之一时才会成功响应:

  • 当字段值为 "*",的时候,目标资源没有任何当前表示形式。
  • 有一种已选表示形式带有一个实体标签,这个实体标签并不与列在这个字段值里的任一实体标签相匹配。

A recipient MUST use the weak comparison function when comparing entity-tags for If-None-Match (Section 2.3.2), since weak entity-tags can be used for cache validation even if there have been changes to the representation data.

当接收端对 If-None-Match 的实体标签进行对比的时候,必须 使用弱对比方法weak comparison function章节 2.3.2)。这是因为即使表示形式数据representation data已经改变,弱验证类型的实体标签还可以用来缓存验证。

  1. If-None-Match = "*" / 1#entity-tag

Examples:

示例:

  1. If-None-Match: "xyzzy"
  2. If-None-Match: W/"xyzzy"
  3. If-None-Match: "xyzzy", "r2d2xxxx", "c3piozzzz"
  4. If-None-Match: W/"xyzzy", W/"r2d2xxxx", W/"c3piozzzz"
  5. If-None-Match: *

If-None-Match is primarily used in conditional GET requests to enable efficient updates of cached information with a minimum amount of transaction overhead. When a client desires to update one or more stored responses that have entity-tags, the client SHOULD generate an If-None-Match header field containing a list of those entity-tags when making a GET request; this allows recipient servers to send a 304 (Not Modified) response to indicate when one of those stored responses matches the selected representation.

If-None-Match 主要用在条件 GET 请求中使缓存信息能够以最小的传输开销来进行高效的更新。当客户端希望更新一个或多个它已经缓存的带有实体标签的响应的时候,客户端 应当 在执行 GET 请求的时候生成一个 If-None-Match 头字段来包含一个这些实体标签的列表,这样使得接收端服务器可以发送一个 304 (Not Modified) 响应来向客户端表明,什么时候这些已缓存的响应之一会匹配已选表示形式selected representation

If-None-Match can also be used with a value of "*" to prevent an unsafe request method (e.g., PUT) from inadvertently modifying an existing representation of the target resource when the client believes that the resource does not have a current representation (Section 4.2.1 of [RFC7231]). This is a variation on the "lost update" problem that might arise if more than one client attempts to create an initial representation for the target resource.

If-None-Match 的值也可以设置为 "*" 来阻止不安全的请求方法(比如,PUT)意外地修改了目标资源已经现存在的一种表示形式,当客户端认为所请求的资源没有这种表示形式的时候(【RFC7231】章节 4.2.1)。这是一种“丢失更新”问题的变种,如果超过一个客户端试图为目标资源创建一个初始表示形式的时候,这种问题可能会发生。

An origin server that receives an If-None-Match header field MUST evaluate the condition prior to performing the method (Section 5). If the field-value is "*", the condition is false if the origin server has a current representation for the target resource. If the field-value is a list of entity-tags, the condition is false if one of the listed tags match the entity-tag of the selected representation.

源服务器接收到一个 If-None-Match 头字段的时候,必须 在执行这个请求方法之前对条件进行求值(章节 5)。如果字段值是 "*",并且源服务器的目标资源有当前表示形式,那么这个条件的求值结果为假。如果字段值是一个实体标签的列表,并且列表中的实体标签之一匹配上已选表示形式的实体标签,那么这个条件的求值结果为假。

An origin server MUST NOT perform the requested method if the condition evaluates to false; instead, the origin server MUST respond with either a) the 304 (Not Modified) status code if the request method is GET or HEAD or b) the 412 (Precondition Failed) status code for all other request methods.

如果条件求值为假,那么,源服务器 禁止 执行所请求的方法,而是,源服务器 必须 响应以下其中之一:

  • 如果请求方法是 GET 或者 HEAD,响应 304 (Not Modified) 状态码,或者
  • 如果是其他请求方法,响应 412 (Precondition Failed) 状态码。

Requirements on cache handling of a received If-None-Match header field are defined in Section 4.3.2 of [RFC7234].

接收到 If-None-Match 头字段时的缓存处理的相关要求,定义在【RFC7234】章节 4.3.2 中。

3.3. If-Modified-Since

The "If-Modified-Since" header field makes a GET or HEAD request method conditional on the selected representation's modification date being more recent than the date provided in the field-value. Transfer of the selected representation's data is avoided if that data has not changed.

If-Modified-Since 头字段使得 GET 或者 HEAD 请求方法带有条件,已选表示形式的修改日期晚于这个字段值的日期的时候,服务器才会成功响应。避免表示形式的数据没有发生改变的情况下再次传输表示形式的数据。

  1. If-Modified-Since = HTTP-date

An example of the field is:

这个字段的示例:

  1. If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT

A recipient MUST ignore If-Modified-Since if the request contains an If-None-Match header field; the condition in If-None-Match is considered to be a more accurate replacement for the condition in If-Modified-Since, and the two are only combined for the sake of interoperating with older intermediaries that might not implement If-None-Match.

如果请求包含有一个 In-None-Match 头字段,那么,接收端 必须 忽略 If-Modified-Since 头字段。在 In-None-Match 里的条件被认为是对在 In-Modified-Since 里的条件的更加精准的替代,结合使用这两种头字段的目的仅在于与可能未实现 If-None-Match 的旧中间人进行交互。

A recipient MUST ignore the If-Modified-Since header field if the received field-value is not a valid HTTP-date, or if the request method is neither GET nor HEAD.

接收端如果接收到的 If-Modified-Since 头字段的值不是一个合法的 HTTP-date,或者这个请求方法既不是 GET 也不是 HEAD 的时候,接收端 必须 忽略这个头字段。

A recipient MUST interpret an If-Modified-Since field-value's timestamp in terms of the origin server's clock.

接收端 必须 依据源服务器的时钟来解释 If-Modified-Since 头字段值里的时间戳。

If-Modified-Since is typically used for two distinct purposes: 1) to allow efficient updates of a cached representation that does not have an entity-tag and 2) to limit the scope of a web traversal to resources that have recently changed.

使用 If-Modified-Since 通常有两个不同的目的:

  • 可以高效地更新一个已缓存的但没有实体标签的表示形式高效;
  • 将网页的资源遍历范围限制为只有最近有改变的资源上。

When used for cache updates, a cache will typically use the value of the cached message's Last-Modified field to generate the field value of If-Modified-Since. This behavior is most interoperable for cases where clocks are poorly synchronized or when the server has chosen to only honor exact timestamp matches (due to a problem with Last-Modified dates that appear to go "back in time" when the origin server's clock is corrected or a representation is restored from an archived backup). However, caches occasionally generate the field value based on other data, such as the Date header field of the cached message or the local clock time that the message was received, particularly when the cached message does not contain a Last-Modified field.

当用于更新缓存的时候,缓存服务器一般使用已缓存的消息的 Last-Modified 字段的值来生成 If-Modified-Since 字段的值。这种行为在以下情况下最有互可操作性:在时钟不同步的场景,或者当服务器选择为只遵循准确时间戳的匹配(由于 Last-Modified 的日期的问题,这个问题具体是这个日期貌似是要回到从前,当源服务器的时钟被修正过或者一个表示形式是恢复自一个归档备份的时候)。但是,缓存服务器偶尔会基于其他数据来生成这个字段值,比如已缓存的消息的 Date 头字段,或者接收到消息时的本地时钟时间,特别是当已缓存的消息并没有包含一个 Last-Modified 字段的时候。

When used for limiting the scope of retrieval to a recent time window, a user agent will generate an If-Modified-Since field value based on either its own local clock or a Date header field received from the server in a prior response. Origin servers that choose an exact timestamp match based on the selected representation's Last-Modified field will not be able to help the user agent limit its data transfers to only those changed during the specified window.

当用于对检索的范围限制为一个最近的时间窗口的时候,用户代理将会生成一个 If-Modified-Since 字段,其值或者基于用户代理的本地时钟,或者基于接收自服务器的之前一个响应的 Date 头字段。源服务器选择准确匹配上基于已选表示形式的 Last-Modified 字段的时间戳,将无法帮助用户代理限制它的数据传输为仅仅是那些具体时间窗口期间的改动。

An origin server that receives an If-Modified-Since header field SHOULD evaluate the condition prior to performing the method (Section 5). The origin server SHOULD NOT perform the requested method if the selected representation's last modification date is earlier than or equal to the date provided in the field-value; instead, the origin server SHOULD generate a 304 (Not Modified) response, including only those metadata that are useful for identifying or updating a previously cached response.

源服务器接收到一个 If-Modified-Since 头字段的时候,应当 在执行请求方法之前对条件进行求值(章节 5)。如果已选表示形式的最后修改时间是早于或等于 If-Modified-Since 所提供的日期,那么,源服务器 不应当 执行所请求的方法,而是,源服务器 应当 生成一个 304 (Not Modified) 响应,只包含那些有用于的元数据,所述有用的元数据指的是用来表明或更新之前所缓存的响应的那些元数据。

Requirements on cache handling of a received If-Modified-Since header field are defined in Section 4.3.2 of [RFC7234].

接收到 If-Modified-Since 头字段时的缓存处理的相关要求,定义在【RFC7234】章节 4.3.2 中。

3.4. If-Unmodified-Since

The "If-Unmodified-Since" header field makes the request method conditional on the selected representation's last modification date being earlier than or equal to the date provided in the field-value. This field accomplishes the same purpose as If-Match for cases where the user agent does not have an entity-tag for the representation.

If-Unmodified-Since 头字段使得请求方法带有条件,已选表示形式的修改日期早于或等于这个字段值的日期的时候,服务器才会成功响应。在用户代理并没有在表示形式上带有实体标签的情况下,这个字段实现了像 If-Match 相同的目的。

  1. If-Unmodified-Since = HTTP-date

An example of the field is:

这个字段的一个示例:

  1. If-Unmodified-Since: Sat, 29 Oct 1994 19:43:31 GMT

A recipient MUST ignore If-Unmodified-Since if the request contains an If-Match header field; the condition in If-Match is considered to be a more accurate replacement for the condition in If-Unmodified-Since, and the two are only combined for the sake of interoperating with older intermediaries that might not implement If-Match.

如果请求包含有一个 If-Match 头字段的时候,接收端 必须 忽略掉 If-Unmodified-Since 字段。在 In-Match 里的条件被认为是对在 In-Unmodified-Since 里的条件的更加精准的替代,结合使用这两种头字段的目的仅在于与可能未实现 If-Match 的旧中间人进行交互。

A recipient MUST ignore the If-Unmodified-Since header field if the received field-value is not a valid HTTP-date.

接收端如果接收到 If-Unmodified-Since 头字段的值不是一个合法的 HTTP-date,接收端 必须 忽略这个头字段。

A recipient MUST interpret an If-Unmodified-Since field-value's timestamp in terms of the origin server's clock.

接收端 必须 依据源服务器的时钟来解释 If-Unmodified-Since 头字段值里的时间戳。

If-Unmodified-Since is most often used with state-changing methods (e.g., POST, PUT, DELETE) to prevent accidental overwrites when multiple user agents might be acting in parallel on a resource that does not supply entity-tags with its representations (i.e., to prevent the "lost update" problem). It can also be used with safe methods to abort a request if the selected representation does not match one already stored (or partially stored) from a prior request.

If-Unmodified-Since 经常与会状态改变state-changing的请求方法一起使用(比如:POST、PUT、DELETE),来避免当多个用户代理可能并行操作同一个不支持实体标签的资源的时候导致的意外覆盖(也就是说,避免“丢失更新”的问题)。它还可以与安全方法safe methods一起使用来中止请求,如果已选表示形式并没有匹配上一个已经(或可能已经)从之前的请求里存储的表示形式。

An origin server that receives an If-Unmodified-Since header field MUST evaluate the condition prior to performing the method (Section 5). The origin server MUST NOT perform the requested method if the selected representation's last modification date is more recent than the date provided in the field-value; instead the origin server MUST respond with either a) the 412 (Precondition Failed) status code or b) one of the 2xx (Successful) status codes if the origin server has verified that a state change is being requested and the final state is already reflected in the current state of the target resource (i.e., the change requested by the user agent has already succeeded, but the user agent might not be aware of that because the prior response message was lost or a compatible change was made by some other user agent). In the latter case, the origin server MUST NOT send a validator header field in the response unless it can verify that the request is a duplicate of an immediately prior change made by the same user agent.

源服务器接收到一个 If-Unmodified-Since 头字段的时候,必须 在执行请求请求方法之前对条件进行求值(章节 5)。如果已选表示形式的最后修改时间是晚于 If-Unmodified-Since 所提供的日期,那么,源服务器 禁止 执行所请求的方法,而是,源服务器 必须 响应以下其中之一:

  • 响应 412 (Precondition Failed) 状态码,或者
  • 如果源服务器检验出目标资源又被请求了一种状态改变,并且它的最终状态已经反映为目标资源当前状态(也就是说,用户代理所请求的改变已经成功完成了,但是用户请求可能没有意识到这个,可能是因为之前的响应已经丢失了没有成功到达用户代理,或者其他某些用户代理也对目标资源请求了一种与之兼容的变化),那么,响应 2xx (Successful) 状态码的其中之一。

对于第一种情况,源服务器 禁止 在响应里发送验证器头字段,除非它能够检验出这个请求与它的同一个用户代理所造成的前一个相邻的变化相重复。

The If-Unmodified-Since header field can be ignored by caches and intermediaries because it is not applicable to a stored response.

If-Unmodified-Since 头字段可以被缓存服务器以及中间人所忽略,因为它并不适用于一个已存储的响应。

3.5. If-Range

The "If-Range" header field provides a special conditional request mechanism that is similar to the If-Match and If-Unmodified-Since header fields but that instructs the recipient to ignore the Range header field if the validator doesn't match, resulting in transfer of the new selected representation instead of a 412 (Precondition Failed) response. If-Range is defined in Section 3.2 of [RFC7233].

If-Range 头字段提供了一种特殊的条件请求机制。它类似于 If-MatchIf-Unmodified-Since 头字段,但它指示接收到去忽略 Range 头字段,如果验证器不匹配的话,其结果是传输新的已选表示形式,而不是一个 412 (Precondition Failed) 响应。If-Range 是定义在【RFC7233】章节 3.2

4. 状态码定义 / Status Code Definitions

4.1. 304 未更改 / 304 Not Modified

The 304 (Not Modified) status code indicates that a conditional GET or HEAD request has been received and would have resulted in a 200 (OK) response if it were not for the fact that the condition evaluated to false. In other words, there is no need for the server to transfer a representation of the target resource because the request indicates that the client, which made the request conditional, already has a valid representation; the server is therefore redirecting the client to make use of that stored representation as if it were the payload of a 200 (OK) response.

304 (Not Modified) 状态码表明:已接收到 GET 或 HEAD 条件请求,如果这个条件的求值结果为假的话,将返回的是一个 200 (OK) 响应。换句话说,服务器不需要传输目标资源的一个表示形式,因为这个请求表明了发起这个条件请求的客户端已经有一个有效的表示形式了,因此服务器让客户端重新使用那个已缓存的表示形式,可以把它当作是一个 200 (OK) 响应的有效载荷。

The server generating a 304 response MUST generate any of the following header fields that would have been sent in a 200 (OK) response to the same request: Cache-Control, Content-Location, Date, ETag, Expires, and Vary.

服务器生成一个 304 响应的时候,假如生成的是一个 200 (OK) 响应到同一个请求,如果这个 200 响应包含下列头字段,那么,服务器 必须 将这些头字段同样生成到 304 响应里,包括:Cache-ControlContent-LocationDateETagExpires、以及 Vary

Since the goal of a 304 response is to minimize information transfer when the recipient already has one or more cached representations, a sender SHOULD NOT generate representation metadata other than the above listed fields unless said metadata exists for the purpose of guiding cache updates (e.g., Last-Modified might be useful if the response does not have an ETag field).

因为 304 响应的目标是在接收端已经有一个或多个已缓存的表示形式的时候让发送端最小化信息传输,因此,发送端 不应当 生成除上述所列出的头字段以外的表示形式元数据representation metadata,除非这些元数据是为指导缓存更新的目的而存在的(比如,Last-Modified 可能有用于如果响应并未带有一个 ETag 字段的情况)。

Requirements on a cache that receives a 304 response are defined in Section 4.3.4 of [RFC7234]. If the conditional request originated with an outbound client, such as a user agent with its own cache sending a conditional GET to a shared proxy, then the proxy SHOULD forward the 304 response to that client.

接收到一个 304 响应时对于缓存服务器的要求,定义在【RFC7234】章节 4.3.4。如果条件请求是源自一个站外的客户端outbound client,比如一个用户代理具有它自己的缓存功能发送了一个条件 GET 到一个共享代理,那么,这个代理 应当 转发这个 304 响应到那个客户端。

A 304 response cannot contain a message-body; it is always terminated by the first empty line after the header fields.

304 响应消息不能包含一个消息体message-body,它总是终止于头字段之后的第一个空行。

4.2. 412 前提条件失败 / 412 Precondition Failed

The 412 (Precondition Failed) status code indicates that one or more conditions given in the request header fields evaluated to false when tested on the server. This response code allows the client to place preconditions on the current resource state (its current representations and metadata) and, thus, prevent the request method from being applied if the target resource is in an unexpected state.

412 (Precondition Failed) 状态码表明:请求头字段所给定的一个或多个条件,在服务器上测试时的求值结果为假。这个响应让客户端可以放置前提条件到当前的资源状态(它的当前表示形式和元数据)上,然后,如果目标资源是处在一种预料之外的状态上时,阻止将请求方法的应用。

5. 求值 / Evaluation

Except when excluded below, a recipient cache or origin server MUST evaluate received request preconditions after it has successfully performed its normal request checks and just before it would perform the action associated with the request method. A server MUST ignore all received preconditions if its response to the same request without those conditions would have been a status code other than a 2xx (Successful) or 412 (Precondition Failed). In other words, redirects and failures take precedence over the evaluation of preconditions in conditional requests.

除非被下面的情况所排除,接收端缓存cache或者源服务器对所接收到的请求在成功完成的一般检查以后,在即将执行请求方法所关联的动作之前,必须 对这个请求的前提条件进行求值。如果一个请求在没有带有某些条件的时候,服务器将会响应除 2xx (Successful)412 (Precondition Failed),那么,相同的请求如果这些带有条件的话,服务器 必须 忽略所有接收到的前提条件。换句话说,在条件请求中,重定向响应redirects以及失败响应failures的优先级高于对前提条件的求值。

A server that is not the origin server for the target resource and cannot act as a cache for requests on the target resource MUST NOT evaluate the conditional request header fields defined by this specification, and it MUST forward them if the request is forwarded, since the generating client intends that they be evaluated by a server that can provide a current representation. Likewise, a server MUST ignore the conditional request header fields defined by this specification when received with a request method that does not involve the selection or modification of a selected representation, such as CONNECT, OPTIONS, or TRACE.

一个服务器,如果它既不是目标资源的源服务器,也不能充当一个所请求的目标资源的缓存服务器,那么,它 禁止 对本规范所定义的条件请求头字段进行求值,并且它 必须 转发这些头字段,如果请求会被转发的话,这是因为生成这些头字段的客户是想让它们被能提供一种当前表示形式的服务器来求值的。同样,当服务器所接收到的条件请求的请求方法并不涉及对已选表示形式的选择或修改(比如 CONNECT、OPTIONS、或者 TRACE)的时候,服务器 必须 忽略由本规范所定义的条件请求头字段。

Conditional request header fields that are defined by extensions to HTTP might place conditions on all recipients, on the state of the target resource in general, or on a group of resources. For instance, the "If" header field in WebDAV can make a request conditional on various aspects of multiple resources, such as locks, if the recipient understands and implements that field ([RFC4918], Section 10.4).

由 HTTP 的扩展所定义的条件请求头字段可能将条件设定为针对所有接收端、或者针对目标资源的普遍状态、或者针对某一类资源。例如,WebDAV 规范里的 If 头字段能够发起一个针对多种资源的各个方面的条件请求,比如locks,如果接收端理解并实现这个字段的话(【RFC4918】章节 10.4)。

Although conditional request header fields are defined as being usable with the HEAD method (to keep HEAD's semantics consistent with those of GET), there is no point in sending a conditional HEAD because a successful response is around the same size as a 304 (Not Modified) response and more useful than a 412 (Precondition Failed) response.

虽然条件请求头字段是定义为可以和 HEAD 方法一起使用(为了保持 HEAD 与 GET 的语义一致),但是发送一个条件 HEAD 请求是没有任何意义的,因为它的成功响应的大小差不多与一个 304 (Not Modified) 响应一样,并且比一个 412 (Precondition Failed) 响应更加实用。

6. 优先级 / Precedence

When more than one conditional request header field is present in a request, the order in which the fields are evaluated becomes important. In practice, the fields defined in this document are consistently implemented in a single, logical order, since "lost update" preconditions have more strict requirements than cache validation, a validated cache is more efficient than a partial response, and entity tags are presumed to be more accurate than date validators.

当一个请求中出现了超过一个条件请求头字段的时候,这些头字段的求值顺序就变得很重要了。实践中,本规范所定义的字段被一致实现为一种单一的逻辑顺序,但因为“丢失更新”的前提条件比缓存验证cache validation有着更加严格的要求,因此,缓存验证比部分响应partial response更加高效,以及,实体标签entity tags被认为比日期验证器date validators更加精准。

A recipient cache or origin server MUST evaluate the request preconditions defined by this specification in the following order:

  1. When recipient is the origin server and If-Match is present, evaluate the If-Match precondition:
    • if true, continue to step 3
    • if false, respond 412 (Precondition Failed) unless it can be determined that the state-changing request has already succeeded (see Section 3.1)
  2. When recipient is the origin server, If-Match is not present, and If-Unmodified-Since is present, evaluate the If-Unmodified-Since precondition:
    • if true, continue to step 3
    • if false, respond 412 (Precondition Failed) unless it can be determined that the state-changing request has already succeeded (see Section 3.4)
  3. When If-None-Match is present, evaluate the If-None-Match precondition:
    • if true, continue to step 5
    • if false for GET/HEAD, respond 304 (Not Modified)
    • if false for other methods, respond 412 (Precondition Failed)
  4. When the method is GET or HEAD, If-None-Match is not present, and If-Modified-Since is present, evaluate the If-Modified-Since precondition:
    • if true, continue to step 5
    • if false, respond 304 (Not Modified)
  5. When the method is GET and both Range and If-Range are present, evaluate the If-Range precondition:
    • if the validator matches and the Range specification is applicable to the selected representation, respond 206 (Partial Content) [RFC7233]
  6. Otherwise,
    • all conditions are met, so perform the requested action and respond according to its success or failure.

接收端缓存服务器或源服务器 必须 按以下的顺序来对本规范所定义的请求前提条件进行求值:

  • 当接收端是源服务器,且出现了 If-Match,那么,对 If-Match 前提条件进行求值:
    • 如果条件为真,跳到步骤 3;
    • 如果条件为假,响应 412 (Precondition Failed),除非它能够确定这个会改变状态的请求已经是成功的;(章节 3.1
  • 当接收端是源服务器,未出现 If-Match,但出现了 If-Unmodified-Since,那么,对 If-Unmodified-Since 前提条件进行求值:
    • 如果条件为真,跳到步骤 3;
    • 如果条件为假,响应 412 (Precondition Failed),除非它能够确定这个会改变状态的请求已经是成功的;(章节 3.4
  • 当出现了 If-None-Match,那么,对 If-None-Match 前提条件进行求值:
    • 如果条件为真,跳到步骤 5;
    • 如果条件为假,且请求方法为 GET 或者 HEAD,响应 304 (Not Modified)
    • 如果条件为假,且请求方法为其他方法,响应 412 (Precondition Failed)
  • 当请求方法是 GET 或者 HEAD,未出现 If-None-Match,但出现了 If-Modified-Since,那么,对 If-Modified-Since 前提条件进行求值:
    • 如果条件为真,跳到步骤 5;
    • 如果条件为假,响应 304 (Not Modified)
  • 当请求方法是 GET,并且 RangeIf-Range 都出现了,那么,对 If-Range 前提条件进行求值:
    • 如果这个验证器匹配上了,并且 Range 规范适用于已选表示形式,那么,响应 206 (Partial Content);【RFC7233
  • 否则
    • 已经遍历了所有条件了,于是执行所请求的动作并根据它的成功或失败作出响应。

Any extension to HTTP/1.1 that defines additional conditional request header fields ought to define its own expectations regarding the order for evaluating such fields in relation to those defined in this document and other conditionals that might be found in practice.

定义额外条件请求头字段的任何 HTTP/1.1 扩展都应该定义它自身期望这些字段相对于本文档所定义的字段以及其他可能在实践中所发现的条件式之间的求值顺序。

7. IANA 注意事项 / IANA Considerations

7.1. 状态码登记 / Status Code Registration

The "Hypertext Transfer Protocol (HTTP) Status Code Registry" located at http://www.iana.org/assignments/http-status-codes has been updated with the registrations below:

《超文本传输协议(HTTP)状态码登记表》位于 http://www.iana.org/assignments/http-status-codes,已经更新了以下登记项。

Value Description Reference
304 Not Modified Section 4.1
312 Precondition Failed Section 4.2

7.2. 头字段登记 / Header Field Registration

HTTP header fields are registered within the "Message Headers" registry maintained at http://www.iana.org/assignments/message-headers/.

HTTP 头字段被登记在《消息头部》登记表中,并维护在 http://www.iana.org/assignments/message-headers/

This document defines the following HTTP header fields, so their associated registry entries have been updated according to the permanent registrations below (see [BCP90]):

本文档定义了以下 HTTP 头字段,因此它们相关联的登记项已经根据以下永久登记条目进行更新(见【BCP90】):

Header Field Name Protocol Status Reference
ETag http standard Section 2.3
If-Match http standard Section 3.1
If-Modified-Since http standard Section 3.3
If-None-Match http standard Section 3.2
If-Unmodified-Since http standard Section 3.4
Last-Modified http standard Section 2.2

The change controller is: "IETF (iesg@ietf.org) - Internet Engineering Task Force".

主管以上条目的变更的是 "IETF (iesg@ietf.org) - Internet Engineering Task Force"。

8. 安全注意事项 / Security Considerations

This section is meant to inform developers, information providers, and users of known security concerns specific to the HTTP conditional request mechanisms. More general security considerations are addressed in HTTP "Message Syntax and Routing" [RFC7230] and "Semantics and Content" [RFC7231].

本章节是为了告诉开发者、信息提供商、以及用户,针对 HTTP 条件请求机制的已知的安全注意事项。《消息句法和路由》【RFC7230】以及《语义和内容》【RFC7231】有更广泛的安全注意事项。

The validators defined by this specification are not intended to ensure the validity of a representation, guard against malicious changes, or detect man-in-the-middle attacks. At best, they enable more efficient cache updates and optimistic concurrent writes when all participants are behaving nicely. At worst, the conditions will fail and the client will receive a response that is no more harmful than an HTTP exchange without conditional requests.

本规范所定义的验证器并不是试图去保证表示形式的有效性validity恶意修改malicious changes的防范、以及中间人攻击man-in-the-middle attacks的检测。最好的情况是,当所有参与者都行为良好,它们使得缓存的更新能够更加高效,使得支持乐观锁的写入。最坏的情况是,条件会失败并且客户端像没有进行条件请求一样正常地接收到响应。

An entity-tag can be abused in ways that create privacy risks. For example, a site might deliberately construct a semantically invalid entity-tag that is unique to the user or user agent, send it in a cacheable response with a long freshness time, and then read that entity-tag in later conditional requests as a means of re-identifying that user or user agent. Such an identifying tag would become a persistent identifier for as long as the user agent retained the original cache entry. User agents that cache representations ought to ensure that the cache is cleared or replaced whenever the user performs privacy-maintaining actions, such as clearing stored cookies or changing to a private browsing mode.

实体标签可能在生成私隐风险方面被滥用。例如,一个网站可能故意构造一个语义有效的实体标签,这个实体标签是一一对应于一个用户或用户代理的,然后将它发送到一个可缓存的响应里,带有一个非常长的新鲜度时间,然后在接下来的条件请求中读取这个实体标签来作为重新识别用户或用户代理的一种方法。只要用户代理保持原始的缓存条目,这种识别型的标签就会成为一种永久的标识符。每当用户执行确保隐私的行为privacy-maintaining actions的时候,缓存表示形式的用户代理应该确保缓存已被清除或者替换,比如清除已存储的 cookies 或者变更为一种隐私浏览模式。

9. 鸣谢 / Acknowledgments

See Section 10 of [RFC7230].

见【RFC7230】章节 10

10. 参考资料 / References

10.1. 规范性参考资料 / Normative References

  • [RFC2119]
  • Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels”, BCP 14, RFC 2119, March 1997.
  • [RFC5234]
  • Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF”, STD 68, RFC 5234, January 2008.
  • [RFC7230]
  • Fielding, R., Ed. and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing”, RFC 7230, June 2014.
  • [RFC7231]
  • Fielding, R., Ed. and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content”, RFC 7231, June 2014.
  • [RFC7233]
  • Fielding, R., Ed., Lafon, Y., Ed., and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Range Requests”, RFC 7233, June 2014.
  • [RFC7234]
  • Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., “Hypertext Transfer Protocol (HTTP/1.1): Caching”, RFC 7234, June 2014.

10.2. 信息性参考资料 / Informative References

  • [BCP90]
  • Klyne, G., Nottingham, M., and J. Mogul, “Registration Procedures for Message Header Fields”, BCP 90, RFC 3864, September 2004.
  • [RFC2616]
  • Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, “Hypertext Transfer Protocol – HTTP/1.1”, RFC 2616, June 1999.
  • [RFC4918]
  • Dusseault, L., Ed., “HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)”, RFC 4918, June 2007.

附录 A:相对 RFC 2616 的变化 / Appendix A. Changes from RFC 2616

The definition of validator weakness has been expanded and clarified. (Section 2.1)

扩充以及明确了验证器的弱验证类型的定义。(章节 2.1

Weak entity-tags are now allowed in all requests except range requests. (Sections 2.1 and 3.2)

现在,允许弱实体标签用在除范围请求以外的所有的请求中。(章节 2.13.2

The ETag header field ABNF has been changed to not use quoted-string, thus avoiding escaping issues. (Section 2.3)

ETag 头字段的 ABNF 规则已经改变为不使用 quoted-string 规则,以避免转义的问题。(章节 2.3

ETag is defined to provide an entity tag for the selected representation, thereby clarifying what it applies to in various situations (such as a PUT response). (Section 2.3)

ETag 被定义为为已选表示形式提供一个实体标签,因此明确了它在各种场景中的适用范围(比如一个 PUT 响应)。(章节 2.3

The precedence for evaluation of conditional requests has been defined. (Section 6)

定义了条件请求的求值优级级。(章节 6

附录 B:引进的 ABNF / Appendix B. Imported ABNF

The following core rules are included by reference, as defined in Appendix B.1 of [RFC5234]: ALPHA (letters), CR (carriage return), CRLF (CR LF), CTL (controls), DIGIT (decimal 0-9), DQUOTE (double quote), HEXDIG (hexadecimal 0-9/A-F/a-f), LF (line feed), OCTET (any 8-bit sequence of data), SP (space), and VCHAR (any visible US-ASCII character).

本规范引用了以下定义在【RFC5234】附录 B.1 中的核心规则:ALPHA (字母)、CR (回车符)、CRLF (回车换行符)、CTL (控制字符)、DIGIT (十进制数字 0-9)、DQUOTE (双引号)、HEXDIG (十六进制数字 0-9/A-F/a-f)、HTAB (水平制表符)、LF (换行符)、OCTET (八位组字节)、SP (空白)以及 VCHAR (【USASCII】可见字符)。

The rules below are defined in [RFC7230]:

以下规则定义在【RFC7230】中:

  1. OWS = <OWS, see [RFC7230], Section 3.2.3>
  2. obs-text = <obs-text, see [RFC7230], Section 3.2.6>

The rules below are defined in other parts:

以下规则定义在其他部分中:

  1. HTTP-date = <HTTP-date, see [RFC7231], Section 7.1.1.1>

附录 C:ABNF 集合 / Appendix C. Collected ABNF

In the collected ABNF below, list rules are expanded as per Section 1.2 of [RFC7230].

下列 ABNF 规则集合中,列表规则是在【RFC7230】章节 1.2 所扩充的。

  1. ETag = entity-tag
  2.  
  3. HTTP-date = <HTTP-date, see [RFC7231], Section 7.1.1.1>
  4.  
  5. If-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS
  6. entity-tag ] ) )
  7. If-Modified-Since = HTTP-date
  8. If-None-Match = "*" / ( *( "," OWS ) entity-tag *( OWS "," [ OWS
  9. entity-tag ] ) )
  10. If-Unmodified-Since = HTTP-date
  11.  
  12. Last-Modified = HTTP-date
  13.  
  14. OWS = <OWS, see [RFC7230], Section 3.2.3>
  15.  
  16. entity-tag = [ weak ] opaque-tag
  17. etagc = "!" / %x23-7E ; '#'-'~'
  18. / obs-text
  19.  
  20. obs-text = <obs-text, see [RFC7230], Section 3.2.6>
  21. opaque-tag = DQUOTE *etagc DQUOTE
  22.  
  23. weak = %x57.2F ; W/

Index

  • 3
    • 304 Not Modified (status code) 4.1, 7.1
  • 4
    • 412 Precondition Failed (status code) 4.2, 7.1
  • B
    • BCP90 7.2, 10.2
  • E
    • ETag header field 2, 2.3, 7.2, A, A
  • G
    • Grammar
      • entity-tag 2.3
      • ETag 2.3
      • etagc 2.3
      • If-Match 3.1
      • If-Modified-Since 3.3
      • If-None-Match 3.2
      • If-Unmodified-Since 3.4
      • Last-Modified 2.2
      • opaque-tag 2.3
      • weak 2.3
  • I
    • If-Match header field 3.1, 6, 7.2
    • If-Modified-Since header field 3.3, 7.2
    • If-None-Match header field 3.2, 7.2, A
    • If-Unmodified-Since header field 3.4, 6, 7.2
  • L
    • Last-Modified header field 2, 2.2, 7.2
  • M
    • metadata 2
  • R
    • RFC2119 1.1, 10.1
    • RFC2616 2.3, 10.2
      • Section 3.11 2.3
    • RFC4918 2, 5, 10.2
      • Section 10.4 5
    • RFC5234 1.2, 10.1, B
      • Appendix B.1 B
    • RFC7230 1, 1.1, 1.2, 2.3.3, 8, 9, 10.1, B, B, B, C
      • Section 1.2 C
      • Section 2.5 1.1
      • Section 3.2.3 B
      • Section 3.2.6 B
      • Section 4 2.3.3
      • Section 7 1.2
      • Section 10 9
    • RFC7231 1, 1, 2.3.3, 2.3.3, 3.2, 8, 10.1, B
      • Section 3 1
      • Section 3.4 2.3.3
      • Section 4.2.1 3.2
      • Section 5.3.4 2.3.3
      • Section 7.1.1.1 B
    • RFC7233 3.5, 6, 10.1
      • Section 3.2 3.5
    • RFC7234 1, 2.2.1, 2.3.1, 3.2, 3.3, 4.1, 10.1
      • Section 4.3.2 3.2, 3.3
      • Section 4.3.4 4.1
  • S
    • selected representation 1
  • V
    • validator 2
      • strong 2.1
      • weak 2.1

Authors' Addresses

  1. Roy T. Fielding (editor)
  2. Adobe Systems Incorporated
  3. 345 Park Ave
  4. San Jose, CA 95110
  5. USA
  6. Email: fielding@gbiv.com
  7. URI: http://roy.gbiv.com/
  1. Julian F. Reschke (editor)
  2. greenbytes GmbH
  3. Hafenweg 16
  4. Muenster, NW 48155
  5. Germany
  6. Email: julian.reschke@greenbytes.de
  7. URI: http://greenbytes.de/tech/webdav/
  1. 阿多(译者)