1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([[66],{340:function(a,e,t){"use strict";t.r(e);var s=t(0),r=Object(s.a)({},(function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("ContentSlotsDistributor",{attrs:{"slot-key":a.$parent.slotKey}},[t("h1",{attrs:{id:"加速网站的最佳实践"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#加速网站的最佳实践"}},[a._v("#")]),a._v(" 加速网站的最佳实践")]),a._v(" "),t("p",[a._v("Best Practices for Speeding Up Your Web Site")]),a._v(" "),t("p",[t("a",{attrs:{href:"https://developer.yahoo.com/performance/rules.html?guccounter=2",target:"_blank",rel:"noopener noreferrer"}},[a._v("原文"),t("OutboundLink")],1)]),a._v(" "),t("p",[t("strong",[a._v("test")])]),a._v(" "),t("h4",{attrs:{id:"_1、减少-http-请求次数(minimize-http-requests)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1、减少-http-请求次数(minimize-http-requests)"}},[a._v("#")]),a._v(" 1、减少 HTTP 请求次数(Minimize HTTP Requests)")]),a._v(" "),t("h4",{attrs:{id:"_2、使用-cdn-内容分发网络(use-a-content-delivery-network)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2、使用-cdn-内容分发网络(use-a-content-delivery-network)"}},[a._v("#")]),a._v(" 2、使用 CDN 内容分发网络(Use a Content Delivery Network)")]),a._v(" "),t("h4",{attrs:{id:"_3、添加有效期或缓存控制头-静态、动态内容分而治之(add-an-expires-or-a-cache-control-header)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3、添加有效期或缓存控制头-静态、动态内容分而治之(add-an-expires-or-a-cache-control-header)"}},[a._v("#")]),a._v(" 3、添加有效期或缓存控制头 - 静态、动态内容分而治之(Add an Expires or a Cache-Control Header)")]),a._v(" "),t("h4",{attrs:{id:"_4、引入-gzip-压缩组件(gzip-components)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4、引入-gzip-压缩组件(gzip-components)"}},[a._v("#")]),a._v(" 4、引入 Gzip 压缩组件(Gzip Components)")]),a._v(" "),t("h4",{attrs:{id:"_5、把样式表放在顶部-head-内(put-stylesheets-at-the-top)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5、把样式表放在顶部-head-内(put-stylesheets-at-the-top)"}},[a._v("#")]),a._v(" 5、把样式表放在顶部 - HEAD 内(Put Stylesheets at the Top)")]),a._v(" "),t("h4",{attrs:{id:"_6、把脚本放在底部(put-scripts-at-the-bottom)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6、把脚本放在底部(put-scripts-at-the-bottom)"}},[a._v("#")]),a._v(" 6、把脚本放在底部(Put Scripts at the Bottom)")]),a._v(" "),t("h4",{attrs:{id:"_7、避勉-css-表达式的使用-动一下鼠标会产生超过一万次的表达式计算(avoid-css-expressions)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7、避勉-css-表达式的使用-动一下鼠标会产生超过一万次的表达式计算(avoid-css-expressions)"}},[a._v("#")]),a._v(" 7、避勉 CSS 表达式的使用 - 动一下鼠标会产生超过一万次的表达式计算(Avoid CSS Expressions)")]),a._v(" "),t("h4",{attrs:{id:"_8、把-javascript-和-css-放到外部来引入的方式使用(make-javascript-and-css-external)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_8、把-javascript-和-css-放到外部来引入的方式使用(make-javascript-and-css-external)"}},[a._v("#")]),a._v(" 8、把 JavaScript 和 CSS 放到外部来引入的方式使用(Make JavaScript and CSS External)")]),a._v(" "),t("h4",{attrs:{id:"_9、减少-dns-解析(reduce-dns-lookups)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_9、减少-dns-解析(reduce-dns-lookups)"}},[a._v("#")]),a._v(" 9、减少 DNS 解析(Reduce DNS Lookups)")]),a._v(" "),t("h4",{attrs:{id:"_10、压缩以最小化-javascript-和-css(minify-javascript-and-css)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_10、压缩以最小化-javascript-和-css(minify-javascript-and-css)"}},[a._v("#")]),a._v(" 10、压缩以最小化 JavaScript 和 CSS(Minify JavaScript and CSS)")]),a._v(" "),t("h4",{attrs:{id:"_11、避勉重定向(avoid-redirects)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_11、避勉重定向(avoid-redirects)"}},[a._v("#")]),a._v(" 11、避勉重定向(Avoid Redirects)")]),a._v(" "),t("h4",{attrs:{id:"_12、移除重复的脚本(remove-duplicate-scripts)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_12、移除重复的脚本(remove-duplicate-scripts)"}},[a._v("#")]),a._v(" 12、移除重复的脚本(Remove Duplicate Scripts)")]),a._v(" "),t("h4",{attrs:{id:"_13、配置-etags(configure-etags)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_13、配置-etags(configure-etags)"}},[a._v("#")]),a._v(" 13、配置 ETags(Configure ETags)")]),a._v(" "),t("h4",{attrs:{id:"_14、使-ajax-可缓存(make-ajax-cacheable)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_14、使-ajax-可缓存(make-ajax-cacheable)"}},[a._v("#")]),a._v(" 14、使 Ajax 可缓存(Make Ajax Cacheable)")]),a._v(" "),t("h4",{attrs:{id:"_15、尽早地刷新下发缓存(flush-the-buffer-early)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_15、尽早地刷新下发缓存(flush-the-buffer-early)"}},[a._v("#")]),a._v(" 15、尽早地刷新下发缓存(Flush the Buffer Early)")]),a._v(" "),t("h4",{attrs:{id:"_16、ajax-请求使用-get-方法(use-get-for-ajax-requests)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_16、ajax-请求使用-get-方法(use-get-for-ajax-requests)"}},[a._v("#")]),a._v(" 16、AJAX 请求使用 GET 方法(Use GET for AJAX Requests)")]),a._v(" "),t("h4",{attrs:{id:"_17、post-load-components"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_17、post-load-components"}},[a._v("#")]),a._v(" 17、Post-load Components")]),a._v(" "),t("h4",{attrs:{id:"_18、预加载组件(preload-components)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_18、预加载组件(preload-components)"}},[a._v("#")]),a._v(" 18、预加载组件(Preload Components)")]),a._v(" "),t("h4",{attrs:{id:"_19、缩减-dom-元素的数量(reduce-the-number-of-dom-elements)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_19、缩减-dom-元素的数量(reduce-the-number-of-dom-elements)"}},[a._v("#")]),a._v(" 19、缩减 DOM 元素的数量(Reduce the Number of DOM Elements)")]),a._v(" "),t("h4",{attrs:{id:"_20、跨域分割组件(split-components-across-domains)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_20、跨域分割组件(split-components-across-domains)"}},[a._v("#")]),a._v(" 20、跨域分割组件(Split Components Across Domains)")]),a._v(" "),t("h4",{attrs:{id:"_21、减小-iframe-的数量(minimize-the-number-of-frames)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_21、减小-iframe-的数量(minimize-the-number-of-frames)"}},[a._v("#")]),a._v(" 21、减小 iframe 的数量(Minimize the Number of frames)")]),a._v(" "),t("h4",{attrs:{id:"_22、没有-404-错误提示(no-404s)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_22、没有-404-错误提示(no-404s)"}},[a._v("#")]),a._v(" 22、没有 404 错误提示(No 404s)")]),a._v(" "),t("h4",{attrs:{id:"_23、缩减-cookie-大小(reduce-cookie-size)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_23、缩减-cookie-大小(reduce-cookie-size)"}},[a._v("#")]),a._v(" 23、缩减 Cookie 大小(Reduce Cookie Size)")]),a._v(" "),t("h4",{attrs:{id:"_24、为组件选用无-cookie-域(use-cookie-free-domains-for-components)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_24、为组件选用无-cookie-域(use-cookie-free-domains-for-components)"}},[a._v("#")]),a._v(" 24、为组件选用无 Cookie 域(Use Cookie-free Domains for Components)")]),a._v(" "),t("h4",{attrs:{id:"_25、减小-dom-访问(minimize-dom-access)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_25、减小-dom-访问(minimize-dom-access)"}},[a._v("#")]),a._v(" 25、减小 DOM 访问(Minimize DOM Access)")]),a._v(" "),t("h4",{attrs:{id:"_26、开发超级事件处理器(develop-smart-event-handlers)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_26、开发超级事件处理器(develop-smart-event-handlers)"}},[a._v("#")]),a._v(" 26、开发超级事件处理器(Develop Smart Event Handlers)")]),a._v(" "),t("h4",{attrs:{id:"_27、选用-不如选用-import-ie(choose-over-import)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_27、选用-不如选用-import-ie(choose-over-import)"}},[a._v("#")]),a._v(" 27、选用 "),t("link"),a._v(" 不如选用 @import - IE(Choose "),t("link"),a._v(" over @import)")]),a._v(" "),t("h4",{attrs:{id:"_28、avoid-filters"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_28、avoid-filters"}},[a._v("#")]),a._v(" 28、Avoid Filters")]),a._v(" "),t("h4",{attrs:{id:"_29、优化图片(optimize-images)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_29、优化图片(optimize-images)"}},[a._v("#")]),a._v(" 29、优化图片(Optimize Images)")]),a._v(" "),t("h4",{attrs:{id:"_30、优化-css-精灵(optimize-css-sprites)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_30、优化-css-精灵(optimize-css-sprites)"}},[a._v("#")]),a._v(" 30、优化 CSS 精灵(Optimize CSS Sprites)")]),a._v(" "),t("h4",{attrs:{id:"_31、不要在-html-中缩放图片(don-t-scale-images-in-html)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_31、不要在-html-中缩放图片(don-t-scale-images-in-html)"}},[a._v("#")]),a._v(" 31、不要在 HTML 中缩放图片(Don't Scale Images in HTML)")]),a._v(" "),t("h4",{attrs:{id:"_32、使收藏图标小一些且可缓存(make-favicon-ico-small-and-cacheable)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_32、使收藏图标小一些且可缓存(make-favicon-ico-small-and-cacheable)"}},[a._v("#")]),a._v(" 32、使收藏图标小一些且可缓存(Make favicon.ico Small and Cacheable)")]),a._v(" "),t("h4",{attrs:{id:"_33、控制组件在-25k-之下(keep-components-under-25k)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_33、控制组件在-25k-之下(keep-components-under-25k)"}},[a._v("#")]),a._v(" 33、控制组件在 25K 之下(Keep Components under 25K)")]),a._v(" "),t("h4",{attrs:{id:"_34、把多个组件打包到一个多段文档中(pack-components-into-a-multipart-document)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_34、把多个组件打包到一个多段文档中(pack-components-into-a-multipart-document)"}},[a._v("#")]),a._v(" 34、把多个组件打包到一个多段文档中(Pack Components into a Multipart Document)")]),a._v(" "),t("h4",{attrs:{id:"_35、避勉空的图片源(avoid-empty-image-src)"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_35、避勉空的图片源(avoid-empty-image-src)"}},[a._v("#")]),a._v(" 35、避勉空的图片源(Avoid Empty Image src)")]),a._v(" "),t("h4",{attrs:{id:""}},[t("a",{staticClass:"header-anchor",attrs:{href:"#"}},[a._v("#")])])])}),[],!1,null,null,null);e.default=r.exports}}]);
|