首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

网站性能优化:cache-control设立详解

2014-01-08 
网站性能优化:cache-control设置详解cache-control是用于控制网页的缓存.常见的取值有private、no-cache、ma

网站性能优化:cache-control设置详解

cache-control是用于控制网页的缓存.常见的取值有private、no-cache、max-age、must- revalidate等,默认为private。

cache-control有哪些属性?

?

其作用根据不同的重新浏览方式分为以下几种情况:

cache-control

打开新窗口(_blank)

private、no-cache、must-revalidate 再次访问服务器
Cache-control: max-age=5(表示当访问此网页后的5秒内再次访问不 会去服务器)

在地址栏回车
值为private或must-revalidate则只有第一次访问时会访问服务器,以后就不再访问。
值为no-cache,那么每次都会访问。
值为max-age,则在过期之前不会重复访问。

按后退按扭
值为private、must-revalidate、max-age,则不会重访问,
值为no-cache,则每次都重复访问

按刷新按扭
无论为何值,都会重复访问

转自:http://www.ggseo.cn/blog/post/cache-control.html

?

热点排行