`
本来不想注册
  • 浏览: 197410 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

HTTP协议中的关于cache得一些知识

阅读更多
1. Pragma

When the no-cache directive is present in a request message, an application SHOULD forward the request toward the origin server even if it has a cached copy of what is being requested. This pragma directive has the same semantics as the no-cache cache-directive and is defined here for backward compatibility with HTTP/1.0. Clients SHOULD include both header fields when a no-cache request is sent to a server not known to be HTTP/1.1 compliant.

i.e.
response.setHeader("Pragma","no-cache"); //HTTP 1.0
<meta http-equiv="Pragma" content="no-cache" />

2. Cache-Control

The Cache-Control general-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. The directives specify behavior intended to prevent caches from adversely interfering with the request or response. These directives typically override the default caching algorithms. Cache directives are unidirectional in that the presence of a directive in a request does not imply that the same directive is to be given in the response.

Note:that HTTP/1.0 caches might not implement Cache-Control and might only implement Pragma: no-cache

no-cache
If the no-cache directive does not specify a field-name, then a cache MUST NOT use the response to satisfy a subsequent request without successful revalidation with the origin server. This allows an origin server to prevent caching even by caches that have been configured to return stale responses to client requests.
If the no-cache directive does specify one or more field-names, then a cache MAY use the response to satisfy a subsequent request, subject to any other restrictions on caching. However, the specified field-name(s) MUST NOT be sent in the response to a subsequent request without successful revalidation with the origin server. This allows an origin server to prevent the re-use of certain header fields in a response, while still allowing caching of the rest of the response.
Note: Most HTTP/1.0 caches will not recognize or obey this directive.

i.e.
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
<meta http-equiv="Cache-Control" content="no-cache" />

no-store
The purpose of the no-store directive is to prevent the inadvertent release or retention of sensitive information (for example, on backup tapes). The no-store directive applies to the entire message, and MAY be sent either in a response or in a request. If sent in a request, a cache MUST NOT store any part of either this request or any response to it. If sent in a response, a cache MUST NOT store any part of either this response or the request that elicited it. This directive applies to both non- shared and shared caches. "MUST NOT store" in this context means that the cache MUST NOT intentionally store the information in non-volatile storage, and MUST make a best-effort attempt to remove the information from volatile storage as promptly as possible after forwarding it.
Even when this directive is associated with a response, users might explicitly store such a response outside of the caching system (e.g., with a "Save As" dialog). History buffers MAY store such responses as part of their normal operation.
The purpose of this directive is to meet the stated requirements of certain users and service authors who are concerned about accidental releases of information via unanticipated accesses to cache data structures. While the use of this directive might improve privacy in some cases, we caution that it is NOT in any way a reliable or sufficient mechanism for ensuring privacy. In particular, malicious or compromised caches might not recognize or obey this directive, and communications networks might be vulnerable to eavesdropping

i.e.
response.setHeader("Cache-Control","no-store"); //HTTP 1.1

3. Expires
The Expires entity-header field gives the date/time after which the response is considered stale. A stale cache entry may not normally be returned by a cache (either a proxy cache or a user agent cache) unless it is first validated with the origin server (or with an intermediate cache that has a fresh copy of the entity).

HTTP/1.1 clients and caches MUST treat other invalid date formats, especially including the value "0", as in the past (i.e., "already expired").

response.setDateHeader("Expires", -1);
or
<meta http-equiv="expires" content="0" />

以上文字摘于:http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Hope knowing how to destoy the session after sumbit.
分享到:
评论

相关推荐

    http协议中英文版

    本篇将基于提供的标题和描述,深入探讨HTTP协议的基本概念、主要特性以及RFC文档的相关知识。 首先,RFC(Request for Comments)是互联网工程任务组(IETF)发布的技术规范,用于记录和传播互联网相关的协议、标准...

    Linux驱动中的DMA和Cache一致性问题

    在Cache工作原理、CPU流水线特性、Linux内存管理以及内核中DMA接口函数的知识点上,开发者需要有足够的理解才能正确处理DMA与Cache之间的一致性问题。 DMA所使用的地址问题,涉及到了处理器的MMU(内存管理单元)和...

    TIC6678多核编程Cache总结.pdf

    下面详细地介绍Cache在TI-6678 DSP多核编程中的相关知识点: Cache概述: Cache作为处理器性能提升的关键技术,能够有效缓解CPU高速处理能力和慢速主存储器之间的矛盾。由于处理器速度远高于主存储器的存取速度,...

    面试中的HTTP协议

    在面试中,了解HTTP协议的知识是评估一个开发人员基础网络理解能力的重要标准。以下是对HTTP协议的一些核心知识点的详细解释: 1. **HTTP工作原理**: - HTTP是非对称通信协议,基于请求/响应模型。客户端(如...

    分块矩阵优化cache

    5. **优化挑战与解决方案**:探讨分块方法的局限性,尤其是关于Cache自冲突的问题,并提出潜在的优化策略。 #### Cache基础原理详解: Cache作为高性能计算中的核心组件,旨在缓解高速CPU与相对较慢的主存储器(如...

    浅谈cache memory 王齐.pdf

    作者承认了文章中存在一些未知的结论和缺乏必要支撑数据的地方,但强调了知识积累的不易和持续探索的重要性。他鼓励更多的人参与到这篇文章的完善过程中,希望广大的读者和研究者能够共同促进这一领域的进步。 需要...

    cache系统介绍

    Cache通常被内置于CPU中,利用快速的静态随机存取存储器(SRAM),因其比动态随机存取存储器(DRAM)快得多,被用来存储最近访问过的数据和指令。由于处理器访问速度远快于主存,Cache的存在有效地减少了处理器因等待...

    http协议 中文版 pdf

    以下是一些关于HTTP协议的关键知识点: 1. **请求方法**:HTTP请求由一系列的方法组成,如GET、POST、PUT、DELETE、HEAD等。GET用于获取资源,POST用于提交数据,PUT用于更新资源,DELETE用于删除资源,HEAD则只...

    浅谈cache memory

    《浅谈cache memory》一书深入探讨了计算机体系结构中至关重要的组成部分——缓存(cache)内存。本书由Wang Qi、Yang Xi和Zhu Yuhao三位作者合作撰写,旨在提供对CPU硬件缓存全面而深刻的见解。下面将根据书籍内容...

    分簇处理器中分簇投机的L0 Cache设计.pdf

    在分簇处理器中,Cache一致性协议可以被设计为分簇的,每个簇可以独立地维护自己的Cache,以提高处理器性能。 知识点8:处理器性能优化 处理器性能优化是分簇处理器技术的重要目标。通过设计新的Cache结构、优化...

    C64+ DSP Cache 一致性

    ### C64x+ DSP Cache 一致性重要知识点详解 #### 一、概述 在现代数字信号处理系统中,为了提高整体系统的性能,通常会在处理器(Core)与低速存储器之间加入高速缓存(Cache)。Cache的主要作用是利用时间局部性和...

    http协议基础.doc

    ### HTTP协议基础知识详解 #### 一、HTTP协议概述 HTTP(HyperText Transfer Protocol),即超文本传输协议,是一种用于从WWW服务器传输超文本到本地浏览器的传输协议。它被设计来传输网页数据,并且它是互联网上...

    多Cache一致性__目录协议模拟器使用方法1

    此外,帮助菜单可能还会提供一些关于Cache一致性和分布式存储系统的背景知识,帮助用户更好地理解上下文。 ### 总结 多Cache一致性目录协议模拟器作为一个教学工具,通过模拟和可视化的方式,使得分布式环境下的...

    http协议头的有关问题

    "关于http header头信息的一些基础知识(搜集).txt"可能包含了一些基本概念和实例,"header.txt"可能是一些具体的HTTP头信息示例,而"http中的header头部.txt"可能深入探讨了特定的头部字段及其用途。 了解和熟练...

    HTTP协议中文版.pdf

    ### HTTP协议核心知识点详解 #### 一、HTTP协议概述 **HTTP**(HyperText Transfer Protocol)是一种用于分布式、协作式和超媒体信息系统的信息传输协议。它最初由Tim Berners-Lee等人设计,目的是为了支持万维网的...

    ti dsp c6000系列 cache的 指南

    标题与描述概述的知识点主要集中在德州仪器(Texas Instruments,简称TI)的TMS320C6000系列数字信号处理器(DSP)中的缓存(cache)管理与使用指南上。这一系列的知识点覆盖了缓存的基本原理、设计考虑、性能优化以及...

    cxl1.1协议的中文翻译版

    根据给定的信息,本文将对Compute Express Link (CXL) 1.1协议进行详细的解析,特别是关注中文翻译版中的核心知识点。 ### CXL 1.1协议简介 #### 标题与描述 标题和描述均指出这是CXL 1.1协议的中文翻译版。CXL是...

    HTTP 协议 的解析 HTTP 协议 的解析

    1.1 客户端(通常是Web浏览器)向服务器发起一个HTTP请求,请求中包含方法(如GET、POST)、URL、协议版本、请求头部和请求体等信息。 1.2 服务器接收到请求后,根据请求内容进行处理。如果请求的是静态资源(如...

Global site tag (gtag.js) - Google Analytics