YSlow的性能测试提示
Add an Expires or a Cache-Control Header
tag: server
There are two aspects to this rule:
- For static components: implement "Never expire" policy by setting far future
Expiresheader - For dynamic components: use an appropriate
Cache-Controlheader to help the browser with conditional requests
Web page designs are getting richer and richer, which means more
scripts, stylesheets, images, and Flash in the page. A first-time
visitor to your page may have to make several HTTP requests, but by
using the Expires header you make those components cacheable. This
avoids unnecessary HTTP requests on subsequent page views. Expires
headers are most often used with images, but they should be used on all components including scripts, stylesheets, and Flash components.
Browsers (and proxies) use a cache to reduce the number and size of
HTTP requests, making web pages load faster. A web server uses the
Expires header in the HTTP response to tell the client how long a
component can be cached. This is a far future Expires header, telling
the browser that this response won't be stale until April 15, 2010.
Expires: Thu, 15 Apr 2010 20:00:00 GMT
If your server is Apache, use the ExpiresDefault directive to set an
expiration date relative to the current date. This example of the
ExpiresDefault directive sets the Expires date 10 years out from the
time of the request.
ExpiresDefault "access plus 10 years"
Keep in mind, if you use a far future Expires header you have to
change the component's filename whenever the component changes. At
Yahoo! we often make this step part of the build process: a version
number is embedded in the component's filename, for example,
yahoo_2.0.6.js.
Using a far future Expires header affects page views only after a
user has already visited your site. It has no effect on the number of
HTTP requests when a user visits your site for the first time and the
browser's cache is empty. Therefore the impact of this performance
improvement depends on how often users hit your pages with a primed
cache. (A "primed cache" already contains all of the components in the
page.) We measured this at Yahoo!
and found the number of page views with a primed cache is 75-85%. By
using a far future Expires header, you increase the number of components
that are cached by the browser and re-used on subsequent page views
without sending a single byte over the user's Internet connection.
YSlow的性能测试提示的更多相关文章
- Yslow网站性能优化工具
Yslow是一款网站性能优化的插件:
- LR接口性能测试提示Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post_message / two_ (转载)
一.在做JAVA接口性能测试时,场景在运行中出现:Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post ...
- [Python爬虫] 在Windows下安装PhantomJS和CasperJS及入门介绍(上)
最近在使用Python爬取网页内容时,总是遇到JS临时加载.动态获取网页信息的困难.例如爬取CSDN下载资源评论.搜狐图片中的“原图”等,此时尝试学习Phantomjs和CasperJS来解决这个问题 ...
- 前端资料QQ群交流
转:https://github.com/jsfront/src/blob/master/qq.md 这本来是我QQ群内部的一份公共约定的日常交流规则,后来得到大伙的一致认可,并用实际行动来捍卫它,使 ...
- 转载 loadrunner的一些问题解决
sckOutOfMemory 7 内存不足 sckInvalidPropertyValue 380 属性值不效 sckGetNotSupported 394 属性不可读 sckGetNotSup ...
- php结合phantomjs实现网页截屏、抓取js渲染的页面
首先PhantomJS快速入门 PhantomJS是一个基于 WebKit 的服务器端 JavaScript API.它全面支持web而不需浏览器支持,其快速,原生支持各种Web标准: DOM 处理, ...
- Linux/Centos下安装部署phantomjs 及使用
PhantomJS 是一个基于 WebKit 的服务器端 JavaScript API.它全面支持web而不需浏览器支持,其快速,原生支持各种Web标准: DOM 处理, CSS 选择器, JSON, ...
- JavaScript资源分享
一. 资源教程: 综合类 前端知识体系 前端知识结构 Web前端开发大系概览 Web前端开发大系概览-中文版 Web Front-end Stack v2.2 En类资源汇总 免费的编程中文书籍索引 ...
- google官方建议使用的网站性能测试工具
转自:http://www.laokboke.net/2013/05/12/google-official-recommended-site-performance-testing-tools/ 最近 ...
随机推荐
- hdu4324 Triangle LOVE (拓扑排序)
这是一道最简单的拓扑排序题,好久没看这个算法了! 有点生疏了! 后附上百度的资料; #include<stdio.h> #include<string.h> int in[50 ...
- linux_windows下配置tomcat区别 ,不同子域名映射不同 项目
windows下 均为修改tomcat/bin/server.xml 在最后 替换 注意 docBase / <Realm className="org.apache.catalina ...
- nginx 开展对RT5350
编译成功nginx的mips该平台后,,至make install生成的文件到一个角落rt5350文件系统. 必须指出的是,在,被放置在文件系统中需要安装文件夹和编译一致:候有release的文件夹, ...
- utf8 和 UTF-8 在使用中的差别
在使用中经常遇到utf-8和utf8,如今最终弄明确他们的使用不同之处了,如今来和大家分享一下,以下我们看一下utf8 和 UTF-8 有什么差别 "UTF-8"是标准写法,ph ...
- 所谓策略,我站在旁边看今天 神刻的样子O2O
雕爷.何许人也? 卖牛腩的大叔? 卖精油的大爷?还是卖烤肉的家伙? 事实上以上答案都是肯定的,他就是阿芙精油,雕爷牛腩创业神话的缔造者.那么雕爷是怎样取得这种创业成功的呢?前段时间我还不清楚雕爷的厉害 ...
- mysql 使用记号
1. 避免重复入库的插入记录方法 向一个数据库中插入且在未存在的情况下插入一行记录.若有主键可以区分则可以使用 replace into 方法, 单偏偏很多时候数据库设计者会设计自增主键,replac ...
- ssh ipv6
从这里学来的.http://blog.mattandanne.org/2012/01/sftpscp-and-ipv6-link-local-addresses.html当采用ipv6的地址去连接另外 ...
- Python - 字符串的替换(interpolation) 具体解释
字符串的插值(interpolation) 具体解释 本文地址: http://blog.csdn.net/caroline_wendy/article/details/27054263 字符串的替换 ...
- 通过扩展改善ASP.NET MVC的验证机制[实现篇]
原文:通过扩展改善ASP.NET MVC的验证机制[实现篇] 在<使用篇>中我们谈到扩展的验证编程方式,并且演示了本解决方案的三大特性:消息提供机制的分离.多语言的支持和多验证规则的支持, ...
- GRIDDATA(表格)第二版
JQUERY 插件开发——GRIDDATA(表格)第二版 开发背景 表格插件之前我也写个一篇,当时写那个插件的时候,我自己还没有总结出写插件的方法,虽然功能实现了,但是使用起来还是有点别扭的,并且需要 ...