Chrome对网页性能的检测--2015-05-05总结
2015-05-05 21:45
330 查看
Chrome浏览器非常强大,使用Chrome浏览器对页面性能进行检测,根据测试的结果进行优化。当然这个结果只是参考,在实际的项目中肯定有特殊情况存在,并不能为了满足某项测试结果而忽略特定情况的存在。
检测结果不仅列出了问题,还定位问题在哪里,可以很快入手解决对应的问题。
问题一:总共有29个可以压缩的JS文件
合并JS文件:Combine external JavaScript
There are multiple resources served from same domain. Consider combining them into as few files as possible.一个域名有多个文件,可以考虑将他们压缩为尽可能少的文件。
启用gzip压缩:Enable gzip compression
Compressing the following resources with gzip could reduce their transfer size by about two thirds (~715 B).启用gzip压缩降低传输大小。
浏览器缓存:Leverage browser caching
The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers。资源没有指定过期时间,浏览器可能不会缓存。
代理缓存:Leverage proxy caching (38) ?
Resources with a "?" in the URL are not cached by most proxy caching servers:
Minimize cookie size
The average cookie size for all requests on this page is 36 B
Serve static content from a cookieless domain (35)
12.8 KB of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:
Specify image dimensions (10)
A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:
网页性能部分
1、优化样式和脚本的顺序:Optimize the order of styles and scripts (4)
The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.
2、把CSS放到head中:Put CSS in the document head (3)
CSS in the document body adversely impacts rendering performance.
3、删除没用的CSS:Remove unused CSS rules (44)
44 rules (19%) of CSS not used by the current page.
4、Use normal CSS property names instead of vendor-prefixed ones (3)
1、Chrome检测工具
F12之后点击Audits然后出现了如下界面,选中重载页面开始检测按钮,然后点击Run按钮,之后就是等待结果。2、检测结果
这个检测结果分为2类,一个是网络,一个是网页性能;检测结果不仅列出了问题,还定位问题在哪里,可以很快入手解决对应的问题。
问题一:总共有29个可以压缩的JS文件
合并JS文件:Combine external JavaScript
There are multiple resources served from same domain. Consider combining them into as few files as possible.一个域名有多个文件,可以考虑将他们压缩为尽可能少的文件。
启用gzip压缩:Enable gzip compression
Compressing the following resources with gzip could reduce their transfer size by about two thirds (~715 B).启用gzip压缩降低传输大小。
浏览器缓存:Leverage browser caching
The following resources are missing a cache expiration. Resources that do not specify an expiration may not be cached by browsers。资源没有指定过期时间,浏览器可能不会缓存。
代理缓存:Leverage proxy caching (38) ?
Resources with a "?" in the URL are not cached by most proxy caching servers:
Minimize cookie size
The average cookie size for all requests on this page is 36 B
Serve static content from a cookieless domain (35)
12.8 KB of cookies were sent with the following static resources. Serve these static resources from a domain that does not set cookies:
Specify image dimensions (10)
A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:
网页性能部分
1、优化样式和脚本的顺序:Optimize the order of styles and scripts (4)
The following external CSS files were included after an external JavaScript file in the document head. To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript.
2、把CSS放到head中:Put CSS in the document head (3)
CSS in the document body adversely impacts rendering performance.
3、删除没用的CSS:Remove unused CSS rules (44)
44 rules (19%) of CSS not used by the current page.
4、Use normal CSS property names instead of vendor-prefixed ones (3)
相关文章推荐
- js/bat批处理调用谷歌浏览器chrome批量打开网页测试web性能
- Chrome之于网页开发的优异性能
- 使用chrome的F12开发人员工具进行网页前端性能测试
- 网页性能优化方法总结
- 网页性能管理详解:浅谈chrome-Timeline及window.requestAnimationFrame()方法
- ERR_BLOCKED_BY_XSS_AUDITOR:Chrome 在此网页上检测到了异常代码:解决办法
- 网页浏览毫秒必争,超强前端网页性能总结
- chrome 浏览器 开发者工具 性能检测 参数解释
- 网页性能管理详解:浅谈chrome-Timeline及window.requestAnimationFrame()方法
- 网页浏览毫秒必争,超强前端网页性能总结
- Chrome 在此网页上检测到了异常代码
- 最近修改chrome的源码,而工程很大,压缩成rar,都有6G左右,用vs2010打开后,速度缓慢,便去寻找性能优化方法,总结如下
- 网页性能管理详解:浅谈chrome-Timeline及window.requestAnimationFrame()方法
- Yahoo对网页设计性能的建议
- 用php抓取网页内容方法总结
- ASP.NET性能优化之让浏览器缓存动态网页的方法
- 前景目标检测1(总结)
- JavaScript性能优化总结
- Atitit 图像清晰度 模糊度 检测 识别 评价算法 源码实现attilax总结
- java编程规范和性能总结有助提高