andyhu1007 发表于 2013-1-29 07:48:20

Two Simple Rules for HTTP Caching


[*]Don’t cache HTML

[*]Use Cache-Control: no-cache for dynamic HTML pages
[*]Use the Last-Modified header with the current file time for static HTML

[*]Cache everything else forever

[*]For all other file types set an Expires header to the maximum future date your web server will allow

[*]Modify URLs by appending a query string in your HTML to any page element you wish to ‘expire’ immediately.
 
     Two Simple Rules for HTTP Caching
 
     给静态内容设置cache的方法
 
 
 
     为了确保IE与Firefox的缓存行为一致,你应该:

[*]总是指定一个Expires头. 一般设置-1使用html页面能即时刷新或者对其它如图片,CSS,javascript脚本资源设置一个特定的过期时间
[*]如果你要强制页面刷新,甚至是点击后台按钮的时候,那就设置 Cache-Control: no-cache, no-store
  Firefox与IE浏览器缓存的两个重要区别
页: [1]
查看完整版本: Two Simple Rules for HTTP Caching