Contenu connexe
Similaire à 高性能网站最佳实践 (20)
高性能网站最佳实践
- 11. Empty vs. Full Cache 1 用户请求 www.yahoo.com 2 用户请求其他页面 3 用户再次请求 www.yahoo.com
- 12. Empty vs. Full Cache with an empty cache 1 用户请求 www.yahoo.com 2 user requests other web pages 3 user re-requests www.yahoo.com
- 13. Empty vs. Full Cache 1 用户请求 www.yahoo.com 2 用户请求其他页面 3 用户再次请求 www.yahoo.com
- 14. Empty vs. Full Cache Expires header 3 用户再次请求 www.yahoo.com with a full cache 1 用户请求 www.yahoo.com 2 用户请求其他页面
- 18. 浏览器 cache 实验 40-60% ~20% page views with empty cache users with empty cache
- 20. 并行下载 两个组件 in parallel per hostname HTTP/1.1 GIF GIF GIF GIF GIF GIF
- 30. 合并脚本,合并样式表 3 7 youtube.com 1.5 6.5 Average 1 4 yahoo.com 1 3 wikipedia.org 2 2 myspace.com 1 9 msn.com 1 1 froogle.google.com 2 7 ebay.com 2 11 cnn.com 1 18 aol.com 1 3 amazon.com Stylesheets Scripts
- 37. 规则 2: 使用 CDN youtube.com Akamai yahoo.com wikipedia.org Akamai, Limelight myspace.com SAVVIS msn.com google.com Akamai, Mirror Image ebay.com cnn.com Akamai aol.com Akamai amazon.com
- 64. 精简 vs. 混淆 原始 JavaScript //this is a test javascript YAHOO.util.CustomEvent = function(type, oScope, silent, signature) { this.type = type; this.scope = oScope || window; this.silent = silent; this.signature = signature || YAHOO.util.CustomEvent.LIST; this.subscribers = []; if (!this.silent) { } var onsubscribeType = "_YUICEOnSubscribe"; if (type !== onsubscribeType) { this.subscribeEvent = new YAHOO.util.CustomEvent(onsubscribeType, this, true); } };
- 65. 精简 vs. 混淆 精简后的 JavaScript YAHOO.util.CustomEvent=function(type,oScope,silent,signature){this.type=type;this. scope=oScope||window;this.silent=silent;this.signature=signature||YAHOO.util. CustomEvent.LIST;this.subscribers=[];if(!this.silent){} var onsubscribeType="_YUICEOnSubscribe";if(type!==onsubscribeType){this.subscribeEv ent=new YAHOO.util.CustomEvent(onsubscribeType,this,true);}};
- 66. 精简 vs. 混淆 混淆后的 JavaScript YAHOO.util.CustomEvent=function (_1,_2,_3,_4){ this.type=_1; this.scope=_2||window; this.silent=_3; this.signature=_4||YAHOO.util.CustomEvent.LIST; this.subscribers=[]; if(!this.silent){ } var _5="_YUICEOnSubscribe"; if(_1!==_5){ this.subscribeEvent=new YAHOO.util.CustomEvent(_5,this,true); } };
- 70. 重定向 no yes – secondary page yes – secondary page yes – secondary page yes – initial page no yes – secondary page yes – initial page yes – secondary page no 重定向 www.youtube.com www.yahoo.com www.wikipedia.org www.myspace.com www.msn.com froogle.google.com www.ebay.com www.cnn.com www.aol.com www.amazon.com
- 77. 其它网站 YSlow 得分情况 前面删除了部分页面,一些公司的案例。 C(79) 豆瓣 D(66) 51.com F(31) 当当 F(40) MSN B(86) Yahoo F(36) 卓越亚马逊 A(91) 百度 A(93) Google D(64) 淘宝 F(26) 新浪 等级 网站