文档详情

腾讯大讲堂09-如何建设高性能网站.ppt

发布:2016-03-19约2.5万字共97页下载文档
文本预览下载声明
* * * * * * * Look out for the Number One * * The data in Table 2 reflects only cookies set at the top domain levels to eliminate any cookies that may have been set by ads * A cookie set at the . domain impacts the response time for every Yahoo! page in the . domain that a user visits. 尽量减少不必要的cookies 将cookie的size缩小 将cookie放到domain level的时候要谨慎小心,尽量不要影响其他的sub domain 将expiration date合理设置 * * 既然对最终用户反应时间的最大影响来自与有多少个组件要被请求,为什么不能一次同时将他们下载完呢?主要是因为http/1.1的规范,浏览器每次只能同时从单个hostname下载两个组件 * 但是如果一个网站将自己的组件平均地分配到两个hostname上,就会像下图 * * 那么到底是不是将组件分配到越多hostname越好呢,我们也做了测试。The experiment measured an empty HTML document with 20 images on the page. The images were fetched from the same servers as those used by real Yahoo! pages. We ran the experiment in a controlled environment using a test harness that fetches a set of URLs repeatedly while measuring how long it takes to load the page on DSL. * * We fetch 20 smaller-sized images (36 x 36 px) and 20 medium-sized images (116 x 61 px). To our surprise, increasing the number of aliases for loading the medium-size images (116 x 61px) worsens the response times using four or more aliases. Increasing the number of aliases by more than two for smaller-sized images (36 x 36px) doesn’t make much of an impact on the overall response time. On average, using two aliases is best. One possible contributor for slower response times is the amount of CPU thrashing on the client caused by increasing the number of parallel downloads. Another issue to consider is that DNS lookup times vary significantly across ISPs and geographic locations. * * * * * check out this image, used on Yahoo!s homepage, or this one from Googles. * * * * serving compressed HTML, CSS, client-side scripts, and any other type of text content. If you make XMLHttpRequests to services that return XML (or JSON, or plain text), make sure your server gzips as well * Theres one gotcha when it comes to serving gzipped content: you must make sure that proxies do not get in y
显示全部
相似文档