{"id":1111,"date":"2009-09-15T13:26:01","date_gmt":"2009-09-15T05:26:01","guid":{"rendered":"http:\/\/nan.im\/blog\/?p=1111"},"modified":"2009-09-15T13:26:01","modified_gmt":"2009-09-15T05:26:01","slug":"%e5%a6%82%e4%bd%95%e8%be%be%e5%88%b0-yahoo-yslow-gradea-%e9%80%9f%e5%ba%a6%e6%8c%87%e6%a0%87%ef%bc%88%e4%ba%8c%ef%bc%89","status":"publish","type":"post","link":"http:\/\/nan.im\/blog\/1111","title":{"rendered":"\u5982\u4f55\u8fbe\u5230 Yahoo! ySlow GradeA \u901f\u5ea6\u6307\u6807\uff08\u4e8c\uff09"},"content":{"rendered":"<p>\u4e0a\u7bc7\u6587\u7ae0\u9488\u5bf9 ySlow \u7684\u524d 7 \u9879\u6307\u6807\u505a\u4e86\u8bf4\u660e\uff0c\u8fd9\u91cc\u7ee7\u7eed\u540e\u9762\u7684 7 \u9879\u6307\u6807\u3002\u867d\u7136\u7f51\u9875\u663e\u793a\u901f\u5ea6\u5bf9\u4e8e SEO \u6216\u8bb8\u610f\u4e49\u6ca1\u6709\u90a3\u4e48\u91cd\u5927\uff0c\u4f46\u5bf9\u4e8e\u7528\u6237\u4f53\u9a8c\u5374\u5341\u5206\u6709\u610f\u4e49\uff0c\u6709\u7edf\u8ba1\u8868\u660e\u7f51\u9875\u5982\u679c\u5728 5 \u79d2\u949f\u5185\u6ca1\u6709\u4e0b\u8f7d\u5b8c\u6210\u5219\u4f1a\u4e22\u5931\u4e00\u534a\u4ee5\u4e0a\u7684\u7528\u6237\uff0c\u4e4b\u540e\u4e0b\u8f7d\u65f6\u95f4\u4e0e\u7528\u6237\u6d41\u5931\u6210\u6307\u6570\u6bd4\u4f8b\u589e\u957f\u3002\u8fd9\u91cc\u5c06\u7ee7\u7eed\u8865\u5145 ySlow \u5728 Small Site or Blog \u6807\u51c6\u4e0b\u7684\u540e 7 \u9879\u6307\u6807\u89e3\u91ca\u53ca\u5982\u4f55\u8fbe\u5230 GradeA \u6307\u6807\u2026\u2026<\/p>\n<p><!--more--><\/p>\n<p><center><a href=\"http:\/\/nan.im\/blog\/wp-content\/uploads\/yslow-grade-a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/nan.im\/blog\/wp-content\/uploads\/yslow-grade-a-322x225.png\" alt=\"yslow-grade-a\" title=\"yslow-grade-a\" width=\"322\" height=\"225\" class=\"aligncenter size-thumbnail wp-image-1111\" \/><\/a><\/center><\/p>\n<p>\u8fd9\u91cc\u7ee7\u7eed\u63cf\u8ff0\u5269\u4e0b\u7684 ySlow \u6280\u672f\u6307\u6807\uff1a<\/p>\n<p> 8\u3001<strong>Avoid URL redirects<\/strong><\/p>\n<p>\u907f\u514d URL \u8df3\u8f6c\uff1a\u907f\u514d\u7f51\u5740\u8df3\u8f6c\uff0c\u5982\u4e00\u4e9b\u8f83\u65e7\u7684\u7ad9\u70b9\u559c\u6b22\u505a\u7f51\u7ad9\u7684\u5f15\u5bfc\u9875\uff0c\u7136\u540e\u91cc\u9762\u52a0\u4e0a\u4f8b\u5982 http-equiv=&#8221;refresh&#8221; \u7684 meta \u6807\u7b7e\u7528\u6765\u8df3\u8f6c\u5230\u9ed8\u8ba4\u680f\u76ee\u7b49\u7b49\u3002\u5982\u679c\u5237\u65b0\u65f6\u95f4\u8fc7\u77ed\u8fd9\u79cd\u65b9\u5f0f\u751a\u81f3\u4f1a\u88ab\u641c\u7d22\u5f15\u64ce\u8ba4\u4e3a\u4f5c\u5f0a\u5bf9\u4e8e SEO \u4e5f\u540c\u6837\u4e0d\u5229\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u5982\u679c\u56e0\u4e3a\u7f51\u7ad9\u6587\u4ef6\u7ed3\u6784\u53d8\u5316\u6216\u5176\u4ed6\u680f\u76ee\u53d8\u5316\u800c\u9700\u8981\u6539\u53d8\u65e7\u7684\u94fe\u63a5\u5730\u5740\u53ef\u4f7f\u7528 301 \u91cd\u5b9a\u5411\u6216 \u7b80\u6d01\u94fe\u63a5 \u89e3\u51b3\u3002<\/p>\n<p> 9\u3001<strong>Remove duplicate JavaScript and CSS<\/strong><\/p>\n<p>\u79fb\u9664\u91cd\u590d\u4ee3\u7801\uff1a\u968f\u7740\u7f51\u7ad9\u4ee3\u7801\u7684\u79ef\u7d2f\uff0c\u6216\u591a\u4e2a\u5f00\u53d1\u4eba\u5458\u7684\u5171\u540c\u534f\u4f5c\uff0c\u4e0d\u53ef\u907f\u514d\u5728\u4ee3\u7801\u91cc\u9762\u4f1a\u51fa\u73b0\u4e00\u4e9b\u91cd\u590d\u4ee3\u7801\uff0c\u6700\u4e3a\u5e38\u89c1\u7684\u5c31\u662f CSS \u7684\u91cd\u590d\u5b9a\u4e49\uff0c\u751a\u81f3 JavaScript \u4e2d\u4e5f\u6709\u53ef\u80fd\u51fa\u73b0\u51fd\u6570\u7684\u91cd\u590d\u95ee\u9898\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u5728\u4fee\u6539 CSS \u6216 JS \u6587\u4ef6\u65f6\u52a1\u5fc5\u5220\u9664\u65e7\u7684\u90e8\u5206\uff0c\u4e0d\u8981\u4e00\u76f4\u5728\u540e\u9762\u7d2f\u52a0\u4ee3\u7801\uff0c\u6dfb\u52a0\u65b0\u4ee3\u7801\u7684\u540c\u65f6\u9700\u8981\u5220\u9664\u65e7\u7684\u91cd\u590d\u4ee3\u7801\u3002<\/p>\n<p>10\u3001<strong>Reduce the number of DOM elements<\/strong><\/p>\n<p>\u51cf\u5c11 DOM \u5143\u7d20\uff1a\u51cf\u5c11\u6587\u6863\u5bf9\u8c61\u6a21\u578b\uff08DOM\uff09\u6570\u91cf\uff0c\u8fd9\u5176\u5b9e\u4e5f\u662f\u4e00\u79cd\u63d0\u9ad8\u9875\u9762\u4fe1\u606f\u71b5\u7684\u624b\u6bb5\uff0c\u901a\u5e38\u5927\u5c0f\u7684\u9875\u9762\u5176\u6709\u7528\u4fe1\u606f\u5185\u5bb9\u6240\u5360\u6bd4\u4f8b\u8d8a\u9ad8\uff0c\u9875\u9762\u4fe1\u606f\u71b5\u4e5f\u8d8a\u9ad8\u5bf9\u4e8e SEO \u975e\u5e38\u6709\u7528\uff0c\u540c\u65f6\u4e5f\u610f\u5473\u7740\u7528\u6700\u5c11\u7684 DOM \u8282\u70b9\u6570\u91cf\u5b9e\u73b0\u9700\u8981\u7684\u6548\u679c\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u51cf\u5c11 DOM \u5143\u7d20\u9700\u8981 HTML \u548c CSS \u7ecf\u9a8c\u7684\u79ef\u7d2f\uff0c\u5b9e\u73b0\u540c\u6837\u7684\u89c6\u89c9\u6548\u679c\u5fc5\u5b9a\u4e0d\u6b62\u4e00\u79cd\u4e24\u79cd\u65b9\u6cd5\uff0c\u4f46\u54ea\u79cd\u65b9\u6cd5\u4f7f\u7528\u7684 DOM \u8282\u70b9\u6700\u5c11\u5c31\u9700\u8981\u957f\u65f6\u95f4\u7ecf\u9a8c\u7684\u79ef\u7d2f\u3002<\/p>\n<p>11\u3001<strong>Avoid HTTP 404 (Not Found) error<\/strong><\/p>\n<p>\u907f\u514d 404 \u9519\u8bef\uff1a\u6240\u8c13 404 \u9875\u9762\u9519\u8bef\u901a\u5e38\u662f\u6d4f\u89c8\u5668\u8bbf\u95ee\u4e0d\u5b58\u5728\u7684\u9875\u9762\u65f6\u670d\u52a1\u5668\u8fd4\u56de\u7684\u9519\u8bef\u4ee3\u7801\uff0c\u5728\u6b63\u5e38\u6d4f\u89c8\u4e2d\u8fd9\u79cd\u60c5\u51b5\u662f\u4e0d\u5e94\u8be5\u51fa\u73b0\u7684\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u4e00\u65e6\u7f51\u7ad9\u6210\u578b\u5f00\u59cb\u5185\u5bb9\u586b\u5145\uff0c\u5c31\u4e0d\u8981\u8f7b\u6613\u6539\u53d8\u7f51\u7ad9 URL \u7ed3\u6784\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u641c\u7d22\u5f15\u64ce\u5df2\u6293\u53d6\u7684\u9875\u9762\uff0c\u4fee\u6539 URL \u5730\u5740\u65f6\u52a1\u5fc5\u4f7f\u7528 301 \u91cd\u5b9a\u5411\u4ee3\u7801\u5bfc\u5411\u6b63\u5e38\u7684\u9875\u9762\uff0c\u5c3d\u91cf\u4fee\u6539\u9875\u9762\u5185\u5bb9\u800c\u4e0d\u662f\u5220\u9664\u3002<\/p>\n<p>12\u3001<strong>Avoid AlphaImageLoader filter<\/strong><\/p>\n<p>\u907f\u514d AlphaImage \u6ee4\u955c\uff1a\u9053\u7406\u8ddf\u524d\u9762\u7684\u7b2c\u4e94\u6761\u7c7b\u4f3c\uff0c\u7531\u4e8e CSS \u6ee4\u955c\u5c5e\u6027\u53ea\u6709 IE \u6d4f\u89c8\u5668\u652f\u6301\u4e14\u9700\u8981\u6d88\u8017\u8f83\u591a\u6d4f\u89c8\u5668\u8d44\u6e90\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u5220\u9664\u6240\u6709 CSS \u6ee4\u955c\uff0c\u66ff\u6362\u4e3a\u56fe\u7247\u80cc\u666f\u6216\u7b26\u5408 W3C \u7684 CSS \u5c5e\u6027\u3002<\/p>\n<p>13\u3001<strong>Do not scale images in HTML<\/strong><\/p>\n<p>\u7981\u6b62\u5728\u7f29\u653e\u56fe\u7247\uff1a\u5728\u9875\u9762 HTML \u91cc\u5e94\u7981\u6b62\u7f29\u653e\u56fe\u7247\uff0c\u5176\u5b9e\u5728\u9875\u9762\u7ed3\u6784\u4fee\u9970\u90e8\u5206\u662f\u4e0d\u63a8\u8350\u4f7f\u7528 img \u6807\u7b7e\u63d2\u5165\u56fe\u7247\u7684\uff0c\u5f53\u7136\u66f4\u4e0d\u7528\u8bf4\u662f\u7f29\u653e\u3002\u8fd9\u6837\u4f1a\u5bfc\u81f4\u4f60\u7684\u9875\u9762\u4e0b\u8f7d\u591a\u4f59\u7684\u6587\u4ef6\u6d41\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u57fa\u4e8e\u7528\u591a\u5927\u7684\u56fe\u7247\u5c31\u505a\u591a\u5927\u601d\u60f3\uff0c\u5c3d\u91cf\u907f\u514d\u5728 html \u4e2d\u63d2\u5165 img \u56fe\u7247\uff0c\u4fee\u9970\u90e8\u5206\u5c3d\u91cf\u4f7f\u7528 CSS \u80cc\u666f\u6765\u51fa\u6548\u679c\u3002<\/p>\n<p>14\u3001<strong>Make favicon small and cacheable<\/strong><\/p>\n<p>\u5236\u4f5c\u5c0f\u7684\u7f13\u5b58\u56fe\u6807\uff1a\u6d4f\u89c8\u5668\u901a\u5e38\u4f1a\u5bf9\u670d\u52a1\u5668\u8ddf\u76ee\u5f55\u8bf7\u6c42 favicon.ico \u56fe\u6807\uff0c\u5982\u679c\u6ca1\u6709\u5c06\u51fa\u73b0\u4e00\u4e2a 404 \u9519\u8bef\u89c1\u524d\u9762 11 \u6761\u3002<\/p>\n<p>\u5177\u4f53\u63aa\u65bd\uff1a\u7531\u4e8e favicon.ico \u5c06\u505a\u4e3a cookie \u5b58\u50a8\uff0c\u66f4\u5c0f\u7684 cookie \u5c06\u51cf\u5c11\u670d\u52a1\u5668\u548c\u5ba2\u6237\u7aef\u5bf9 cookie \u7684\u6d4f\u89c8\u3002\u4f7f\u7528\u4e13\u4e1a\u7684\u56fe\u6807\u53ca\u56fe\u7247\u4f18\u5316\u5de5\u5177\uff0c\u4f7f\u7528\u538b\u7f29\u7684\u6587\u4ef6\u683c\u5f0f\u5904\u7406\u7b49\u7b49\u65b9\u6cd5\u90fd\u53ef\u4ee5\u5927\u5927\u51cf\u5c0f\u56fe\u6807\u6587\u4ef6\u7684\u5927\u5c0f\u3002<\/p>\n<p>\u81f3\u6b64\uff0c\u5173\u4e8e Yahoo! ySlow \u91cc\u9762 Small Site or Blog \u6807\u51c6\u91cc\u9762\u7684 14 \u9879\u6307\u6807\u5168\u90e8\u4ecb\u7ecd\u5b8c\u6bd5\uff0c\u8fd9\u4e5f\u662f\u63d0\u9ad8\u7f51\u7ad9\u901f\u5ea6\u6700\u57fa\u672c\u7684 14 \u9879\u63aa\u65bd\uff0c\u5728\u4ee5\u540e\u7684\u6587\u7ae0\u91cc\u5c06\u7ee7\u7eed\u4ecb\u7ecd\u7528\u4e8e Classic v1 \u6807\u51c6\u53ca ySlow v2 \u6807\u51c6\u7684\u5176\u4ed6\u4e00\u4e9b\u6307\u6807\uff0c\u8fd9\u4e9b\u6307\u6807\u5bf9\u4e8e\u4e2d\u5927\u578b\u7f51\u7ad9\u5c06\u975e\u5e38\u6709\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u7bc7\u6587\u7ae0\u9488\u5bf9 ySlow \u7684\u524d 7 \u9879\u6307\u6807\u505a\u4e86\u8bf4\u660e\uff0c\u8fd9\u91cc\u7ee7\u7eed\u540e\u9762\u7684 7 \u9879\u6307\u6807\u3002\u867d\u7136\u7f51\u9875\u663e\u793a\u901f\u5ea6\u5bf9\u4e8e SEO  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[24,116,95,117],"class_list":["post-1111","post","type-post","status-publish","format-standard","hentry","category-tech","tag-develop","tag-seo","tag-wordpress","tag-yahoo"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"_links":{"self":[{"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/posts\/1111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/comments?post=1111"}],"version-history":[{"count":0,"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/posts\/1111\/revisions"}],"wp:attachment":[{"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/media?parent=1111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/categories?post=1111"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nan.im\/blog\/wp-json\/wp\/v2\/tags?post=1111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}