
HTTP协议
告别只是另一种体验
专注于前端开发因为专注所以简单
展开
-
如何设置max-age或expires来缓存你的站点文件
方法: 详情: Cache-control用于控制HTTP缓存(在HTTP/1.0中可能部分没实现,仅仅实现了Pragma: no-cache)数据包中的格式:Cache-Control: cache-directivecache-directive可以为以下:request时用到:| “no-cache” | “no-store” | “max-age” “=” delta-secon原创 2016-05-28 23:19:24 · 4002 阅读 · 0 评论 -
优化建议解决方案:未设置max-age或expires
网页的缓存是由 HTTP 消息头中的 “Cache-control” 来控制的,常见的取值有 private、no-cache、max-age、must-revalidate 等,默认为private。其作用根据不同的重新浏览方式分为以下几种情况:(1) 打开新窗口如果指定cache-control的值为private、no-cache、must-revalidate,那么打开新窗口访问时都会重新访原创 2016-05-28 23:23:52 · 3921 阅读 · 0 评论