惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
The Blog of Author Tim Ferriss
D
Docker
博客园 - 聂微东
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
量子位
宝玉的分享
宝玉的分享
博客园 - 司徒正美
The Cloudflare Blog
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC

博客园 - 三体星

5.12 纪念 同志们,我搬家了:oakley.yo2.cn 有点累 3/9[Update] 2/19 2/12 2.5 01/15 doubanclaim7506ce0560ac4303 01/04 00/00 11/21-真正的旅行 11/21 12/21 12/08 12/07 12/06 源氏物语 11/02
3/23[关于浏览器缓存] - 三体星 - 博客园
三体星 · 2009-03-23 · via 博客园 - 三体星

功能:根据Yslow原则,缓存合适使用,可以大大提高速度。
使用Http头:

Cache-Control 用于控制HTTP缓存
Expires 表示存在时间

设置格式如下:

<meta http-equiv="Cache-Control"
content="max-age=7200" />
<meta http-equiv="Expires" content="Mon, 20 Jul 2009
23:00:00 GMT" />

在servlet中设置:

response.setContentType("application/octet-stream");

response.setHeader("Cache-Control","max-age=300");
setDateHeader
setIntHeadr

现象1:在Firefox下,刷新的时候,对于非静态地址,都会重新加载,返回200,静态内容返回304,是检测是否更新的。而在地址栏中回车,以及后退的时候,对于缓存的内容不会重新加载。IE下未测试。

-----------------------------
http://www.w3.org/Protocols/
http://www.ietf.org/internet-drafts/draft-ietf-httpbis-p6-cache-06.txt