6. History Lists
user agent 通常具有 history mechanism, 例如 "Back" button 和 history list, 可用于重新显示会话中较早检索到的 representation.
freshness model (Section 4.2) 不一定适用于 history mechanism. 也就是说, 即使先前的 representation 已经过期, history mechanism 仍然可以显示它.
这并不禁止 history mechanism 告知用户某个 view 可能 stale, 也不禁止它遵守 cache directive, 例如 Cache-Control: no-store.
7. IANA Considerations
本规范为 IANA 使用定义两个新 registry, 如以下各节所述. 此外, 它还注册先前定义的 header field, 升级其状态, 并注册先前未注册的 MIME type.
7.1. Cache Directive Registry
"Hypertext Transfer Protocol (HTTP) Cache Directive Registry" 定义 cache directive 的 namespace. 该 registry 已创建, 现在维护于 http://www.iana.org/assignments/http-cache-directives.
7.1.1. Procedure
registration MUST 包含以下 field:
- Cache Directive Name
- Pointer to specification text
要添加到该 namespace 的 value 需要 IETF Review (见 [RFC5226] Section 4.1).
7.1.2. Considerations for New Cache Control Directives
新的 extension directive ought to 考虑定义:
- directive 被多次指定意味着什么,
- 当 directive 不接受 argument 时, 出现 argument 意味着什么,
- 当 directive 接受 argument 时, 缺少 argument 意味着什么.
另见 Section 5.2.3.
8. Security Considerations
本节旨在告知 developer, information provider 和 user 与 HTTP caching 特定相关的已知安全问题.
cache 会暴露额外的潜在漏洞, 因为 cache content 是恶意利用的有吸引力目标. 由于 cache content 在 HTTP request 完成后仍然存在, 对 cache 的攻击可能在用户认为信息已经从网络中移除很久之后仍泄露这些信息. 因此, cache content 需要作为 sensitive information 加以保护.
此外, caching 的以下方面可能导致问题:
Timing Attacks
cache 的主要用途之一是通过避免传输 cache 中已保存的信息来优化性能, 但这类优化也可能被用于执行 timing attack. 具体而言, 能够检测 cache 最近是否被用于访问某些 resource, 可能会泄露用户 browsing history 中的模式.
缓解措施包括使用 encrypted connection 防止第三方观察, 以及通过谨慎设计限制 attacker 探测 cache state 的能力.
Exposure of Sensitive Information
shared cache 按定义可由多个 user 访问, 并且可能跨多个 organization 访问. 此类 cache 需要仔细区分 authorized content 和 unauthorized content, 以避免返回不适当的 response. cache implementation 需要谨慎并严格遵守 private, no-cache 和 no-store 等可能表示 sensitive information 的 directive.
Poisoning of Caches
对 cache 的主要攻击之一是通过引入 bogus response 来 "poison" 它们. poisoned cache 的影响取决于 cache 对 bogus response 的处理. 如果 cache 将 bogus response 视为 authoritative, 则 cache 可用于在较长时间内提供不正确的信息.
可以通过在缓存 response 之前正确 validation response, 以及使用 secure connection 防止 man-in-the-middle attack, 来缓解 cache poisoning.