{"id":1119,"date":"2010-09-30T08:42:00","date_gmt":"2010-09-30T00:42:00","guid":{"rendered":"\/?p=1119"},"modified":"2010-09-30T08:42:00","modified_gmt":"2010-09-30T08:42:00","slug":"1119","status":"publish","type":"post","link":"https:\/\/blog.vimge.com\/archives\/architecture\/1119.html","title":{"rendered":"[CDN]\u52a8\u6001\u5185\u5bb9\u7684\u7f13\u5b58\u6280\u672f CSI,SSI,ESI"},"content":{"rendered":"

      CDN \u4e2d\u52a8\u6001\u5185\u5bb9\u662f\u4e0d\u592a\u597d\u89e3\u51b3\u7684\uff0c\u901a\u5e38\u9700\u8981\u5f88\u9ebb\u70e6\u7684\u6280\u672f\u548c\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\uff0c\u6bd4\u5982\u6211\u8bbe\u8ba1\u8fc7\u4e00\u79cd\u52a8\u6001\u7f13\u5b58\u7684\u65b9\u6cd5\uff0c\u57fa\u4e8e session \u680f\u63a5\uff0c\u7136\u540e\u6839\u636e\u70ed\u70b9\u6765\u505a\u52a8\u6001\u7f13\u5b58\u65f6\u95f4\u7684\u63a7\u5236\u3002\u76ee\u524d\u5f00\u653e\u7684\u5b9e\u73b0 Cache \u7684\u6280\u672f\u4e3b\u8981\u6709 CSI,SSI,ESI \u4e4b\u7c7b\u51e0\u79cd\u3002\u5728\u4e00\u4e2a\u52a8\u6001\u7f51\u9875\u4e2d,\u5185\u5bb9\u4e0d\u65ad\u66f4\u65b0\u548c\u53d8\u5316\uff0c\u4f46\u8fd9\u5e76\u4e0d\u610f\u5473\u4e0d\u80fd\u7f13\u5b58\uff0c\u5176\u5b9e\u8fd8\u662f\u6709 90% \u7684\u5185\u5bb9\u90fd\u53ef\u4ee5\u505a\u5230 CDN\u4e2d\u7684\u3002\u53ea\u8981\u82b1\u70b9\u5fc3\u601d\u3002\u4f46\u8fd9\u4e9b\u90fd\u5bf9\u5ba2\u6237\u6709\u66f4\u52a0\u9ad8\u7684\u8981\u9700\u6c42\u3002\u4e0b\u9762\u662f\u8fd9\u5411\u79cd\u6280\u672f\u7684\u4ecb\u7ecd\u3002<\/p>\n

\u52a8\u6001 Cache \u9875\u9762\u6709\u5982\u4e0b\u4e00\u4e9b\u65b9\u6848\uff1a<\/p>\n

  1\u3001Client Side Includes(CSI)\uff1a<\/strong><\/p>\n

\u901a\u8fc7iframe\u3001javascript\u3001ajax \u7b49\u65b9\u5f0f\u5c06\u53e6\u5916\u4e00\u4e2a\u9875\u9762\u7684\u5185\u5bb9\u52a8\u6001\u5305\u542b\u8fdb\u6765\u3002\u8fd9\u6837\u6765\u5b9e\u73b0\u52a8\u6001\u5316\u3002<\/p>\n

     \u4f18\u70b9\uff1a\u80fd\u591f\u5229\u7528\u6d4f\u89c8\u5668\u5ba2\u6237\u7aef\u5e76\u884c\u5904\u7406\u53ca\u88c5\u8f7d\u7684\u673a\u5236\uff1b\u8fd9\u79cd\u6280\u672f\u57fa\u672c\u4e0d\u9700\u8981\u670d\u52a1\u5668\u652f\u6301\u548c\u4fee\u6539\uff0c\u8ba1\u7b97\u548c\u64cd\u4f5c\u653e\u5728\u5ba2\u6237\u7aef\uff0c\u80fd\u591f\u964d\u4f4e\u670d\u52a1\u5668\u7aef\u538b\u529b<\/p>\n

     \u7f3a\u70b9\uff1a\u641c\u7d22\u5f15\u64ce\u4f18\u5316\u95ee\u9898\uff1bjavascript\u517c\u5bb9\u6027\u95ee\u9898\uff1b\u5ba2\u6237\u7aef\u7f13\u5b58\u53ef\u80fd\u5bfc\u81f4\u670d\u52a1\u5668\u7aef\u5185\u5bb9\u66f4\u65b0\u540e\u4e0d\u80fd\u53ca\u65f6\u751f\u6548\u3002\u5e38\u5e38\u901a\u8fc7\u52a0 js version \u6765\u89e3\u51b3.<\/p>\n

  2\u3001Server Side Includes(SSI)\uff1a<\/strong><\/p>\n

SSI\u5b83\u5c31\u662fHTML\u6587\u4ef6\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u6ce8\u91ca\u884c\u8c03\u7528\u7684\u547d\u4ee4\u6216\u6307\u9488\u3002\u5b9e\u73b0\u6574\u4e2a\u7f51\u7ad9\u7684\u5185\u5bb9\u66f4\u65b0\u3002SSI\u9700\u8981\u7279\u6b8a\u7684\u6587\u4ef6\u540e\u7f00(shtml,inc).<\/p>\n

      \u4f18\u70b9\uff1aSSI\u6280\u672f\u662f\u901a\u7528\u6280\u672f\uff0c\u4e0d\u53d7\u5177\u4f53\u8bed\u8a00\u9650\u5236\uff0c\u53ea\u9700\u8981Web\u670d\u52a1\u5668\u6216\u5e94\u7528\u670d\u52a1\u5668\u652f\u6301\u5373\u53ef\uff0cNgnix\u3001Apache\u3001Tomcat\u3001Jboss\u7b49\u5bf9\u6b64\u90fd\u6709\u8f83\u597d\u7684\u652f\u6301\uff0c\u76ee\u524d Squid \u4e0d\u652f\u6301\u3002<\/p>\n

      \u7f3a\u70b9\uff1aSSI\u5728\u8bed\u6cd5\u4e0a\u4e0d\u80fd\u591f\u76f4\u63a5\u5305\u542b\u5176\u4ed6\u670d\u52a1\u5668\u7684url\uff0c\u53ea\u80fd\u5728\u5f53\u524d\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u3002\u6240\u4ee5\u901a\u8fc7 CDN \u4e4b\u7c7b\u7684 Cache \u65f6\uff0c\u8fd8\u662f\u4f1a\u5931\u6548\uff0c\u4e0d\u7075\u6d3b.<\/p>\n

    3\u3001Edge Side Includes (ESI)\uff1a<\/strong><\/p>\n

       Edge Side Includes(ESI) \u548cServer Side Includes(SSI)\u548c\u529f\u80fd\u7c7b\u4f3c\u3002SSI\u9700\u8981\u7279\u6b8a\u7684\u6587\u4ef6\u540e\u7f00(shtml,inc)\u3002ESI\uff08Edge Side Include\uff09\u901a\u8fc7\u4f7f\u7528\u7b80\u5355\u7684\u6807\u8bb0\u8bed\u8a00\u6765\u5bf9\u90a3\u4e9b\u53ef\u4ee5\u52a0\u901f\u548c\u4e0d\u80fd\u52a0\u901f\u7684\u7f51\u9875\u4e2d\u7684\u5185\u5bb9\u7247\u65ad\u8fdb\u884c\u63cf\u8ff0\uff0c\u6bcf\u4e2a\u7f51\u9875\u90fd\u88ab\u5212\u5206\u6210\u4e0d\u540c\u7684\u5c0f\u90e8\u5206\u5206\u522b\u8d4b\u4e88\u4e0d\u540c\u7684\u7f13\u5b58\u63a7\u5236 \u7b56\u7565\uff0c\u4f7fCache\u670d\u52a1\u5668\u53ef\u4ee5\u6839\u636e\u8fd9\u4e9b\u7b56\u7565\u5728\u5c06\u5b8c\u6574\u7684\u7f51\u9875\u53d1\u9001\u7ed9\u7528\u6237\u4e4b\u524d\u5c06\u4e0d\u540c\u7684\u5c0f\u90e8\u5206\u52a8\u6001\u5730\u7ec4\u5408\u5728\u4e00\u8d77\u3002\u901a\u8fc7\u8fd9\u79cd\u63a7\u5236\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u51cf\u5c11\u4ece\u670d\u52a1\u5668\u6293\u53d6\u6574\u4e2a \u9875\u9762\u7684\u6b21\u6570\uff0c\u800c\u53ea\u7528\u4ece\u539f\u670d\u52a1\u5668\u4e2d\u63d0\u53d6\u5c11\u91cf\u7684\u4e0d\u80fd\u7f13\u5b58\u7684\u7247\u65ad\uff0c\u56e0\u6b64\u53ef\u4ee5\u6709\u6548\u964d\u4f4e\u539f\u670d\u52a1\u5668\u7684\u8d1f\u8f7d\uff0c\u540c\u65f6\u63d0\u9ad8\u7528\u6237\u8bbf\u95ee\u7684\u54cd\u5e94\u65f6\u95f4\u3002<\/p>\n

\u4f18\u70b9\uff1a ESI\u66f4\u9002\u5408\u7528\u4e8e\u7f13\u5b58\u670d\u52a1\u5668\u4e0a\uff0c\u7f13\u5b58\u6574\u4e2a\u9875\u9762\u6216\u9875\u9762\u7247\u6bb5\uff0c\u56e0\u6b64ESI\u7279\u522b\u9002\u5408\u7528\u4e8e\u7f13\u5b58\uff0cCDN \u7684\u7b2c\u4e00\u540d\u7684\u8001\u5927\uff0cAkamai \u5168\u529b\u652f\u6301\u534f\u8bae\u3002\u5bf9\u4e8e\u5e03\u7f6e\u548c Cache \u90fd\u662f\u6700\u53cb\u597d\u7684\u3002<\/p>\n

\u7f3a\u70b9\uff1a \u51fa\u6765\u5f88\u4e45\uff0c\u4e00\u76f4\u6ca1\u6709\u591a\u5c11\u4eba\u4f7f\u7528\u3002\u4f1a\u8fd9\u4e2a\u6280\u672f\u7684\u7a0b\u5e8f\u5458\u4e0d\u591a\u3002<\/p>\n

\u8f6c\u8f7d\u81ea\uff1ahttp:\/\/www.php-oa.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

      CDN \u4e2d\u52a8\u6001\u5185\u5bb9\u662f\u4e0d\u592a\u597d\u89e3\u51b3\u7684\uff0c\u901a\u5e38\u9700\u8981\u5f88\u9ebb\u70e6\u7684\u6280\u672f\u548c\u65b9\u6cd5\u6765\u5b9e\u73b0\u8fd9\u4e9b\u529f\u80fd\uff0c\u6bd4\u5982\u6211\u8bbe\u8ba1\u8fc7\u4e00\u79cd\u52a8\u6001\u7f13\u5b58\u7684\u65b9\u6cd5\uff0c\u57fa\u4e8e session \u680f\u63a5\uff0c\u7136\u540e\u6839\u636e\u70ed\u70b9\u6765\u505a\u52a8\u6001\u7f13\u5b58\u65f6\u95f4\u7684\u63a7\u5236\u3002\u76ee\u524d\u5f00\u653e\u7684\u5b9e\u73b0 Cache \u7684\u6280\u672f\u4e3b\u8981\u6709 CSI,SSI,ESI \u4e4b\u7c7b\u51e0\u79cd\u3002\u5728\u4e00\u4e2a\u52a8\u6001\u7f51\u9875\u4e2d,\u5185\u5bb9\u4e0d\u65ad\u66f4\u65b0\u548c\u53d8\u5316\uff0c\u4f46\u8fd9\u5e76\u4e0d\u610f\u5473\u4e0d\u80fd\u7f13\u5b58\uff0c\u5176\u5b9e\u8fd8\u662f\u6709 90% \u7684\u5185\u5bb9\u90fd\u53ef\u4ee5\u505a\u5230 CDN\u4e2d\u7684\u3002\u53ea\u8981\u82b1\u70b9\u5fc3\u601d\u3002\u4f46\u8fd9\u4e9b\u90fd\u5bf9\u5ba2\u6237\u6709\u66f4\u52a0\u9ad8\u7684\u8981\u9700\u6c42\u3002\u4e0b\u9762\u662f\u8fd9\u5411\u79cd\u6280\u672f\u7684\u4ecb\u7ecd\u3002<\/p>\n

\u52a8\u6001 Cache \u9875\u9762\u6709\u5982\u4e0b\u4e00\u4e9b\u65b9\u6848\uff1a<\/p>\n

  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1119"}],"collection":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/comments?post=1119"}],"version-history":[{"count":0,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/posts\/1119\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/media?parent=1119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/categories?post=1119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.vimge.com\/wp-json\/wp\/v2\/tags?post=1119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}