{"id":237,"date":"2010-06-23T01:04:08","date_gmt":"2010-06-22T16:04:08","guid":{"rendered":"http:\/\/blog.xcir.net\/?p=237"},"modified":"2011-09-24T02:21:01","modified_gmt":"2011-09-23T17:21:01","slug":"varnish2-1-2%e3%81%a7esi%e3%81%8c%e4%bd%bf%e3%81%84%e6%98%93%e3%81%8f%e3%81%aa%e3%81%a3%e3%81%a6%e3%81%84%e3%81%9f%e4%bb%b6%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6varnish2-0-6%e3%81%a8%e6%af%94%e8%bc%83","status":"publish","type":"post","link":"https:\/\/blog.xcir.net\/?p=237","title":{"rendered":"Varnish2.1.2\u3067ESI\u304c\u4f7f\u3044\u6613\u304f\u306a\u3063\u3066\u3044\u305f\u4ef6\u306b\u3064\u3044\u3066(Varnish2.0.6\u3068\u6bd4\u8f03\u3057\u3066\uff09"},"content":{"rendered":"<p>\u4ee5\u524d\u66f8\u3044\u305f\u8a18\u4e8b\uff08<a href=\"http:\/\/blog.xcir.net\/index.php\/2010\/02\/varnish%E3%81%A7esi%E3%82%92%E4%BD%BF%E3%81%86%E3%81%A8%E3%81%8D%E3%81%AE%E6%B3%A8%E6%84%8F%E3%81%99%E3%82%8B%E3%81%B9%E3%81%8D%E7%82%B9\/\">Varnish\u3067ESI\u3092\u4f7f\u3046\u3068\u304d\u306e\u6ce8\u610f\u3059\u308b\u3079\u304d\u70b9<\/a>\uff09\u3067<\/p>\n<blockquote><p>\n<strong>Keep-Alive\u306fOFF\u306b\u3059\u308b\u3079\u304d<\/strong><\/p>\n<p>ESI\u4f7f\u7528\u6642\u306fcontent-length\u304c\u30d6\u30e9\u30a6\u30b6\u5074\u306b\u8fd4\u5374\u3055\u308c\u306a\u3044\u3088\u3046\u306a\u306e\u3067OFF\u306f\u307b\u307c\u5fc5\u9808\u3067\u3059<br \/>\n\u3069\u3046\u3057\u3066\u3082\u4f7f\u3044\u305f\u3044\u5834\u5408\u306fESI\u3092\u4f7f\u7528\u3059\u308b\u3068\u304d\u306e\u307fkeep-alive\u3092OFF\u306b\u30fb\u30fb\u30fb\n<\/p><\/blockquote>\n<p>\u3068<\/p>\n<blockquote><p>\n<strong>\u76f4Varnish\u306f\u3084\u3081\u305f\u65b9\u304c\u3044\u3044<\/strong><\/p>\n<p>Keep-alive\u3092\u30aa\u30d5\u306b\u3057\u3066\u3082\u7279\u5b9a\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8(ab\/wget\u306a\u3069\uff09\u3067\u63a5\u7d9a\u304c\u7dad\u6301\u3055\u308c\u30665\u79d2\u307b\u3069\u5f85\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059<br \/>\n\u3064\u307e\u308aKeep-Alive\u304c\u6709\u52b9\u304b\u3064content-length\u304c\u306a\u3044\u3068\u304d\u306e\u6319\u52d5\u3068\u540c\u3058\u306b\u306a\u308a\u307e\u3059<br \/>\n\u3058\u3083\u3041\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u304b\uff1f<br \/>\n\u81ea\u5206\u306f\u30d5\u30ed\u30f3\u30c8\u306bNginx\u3092\u7f6e\u3044\u3066\u305d\u3053\u304b\u3089Varnish\u306bproxy\u3057\u3066\u3044\u307e\u3059\n<\/p><\/blockquote>\n<p>\u3068\u66f8\u304d\u307e\u3057\u305f\u304c\u3069\u3046\u3084\u30892.1.X\u7cfb\u3067\u306f\u6539\u5584\u3055\u308c\u305f\u3088\u3046\u3067\u3059<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u6bd4\u8f03\u3057\u3066\u307f\u307e\u3059<br \/>\n<!--more--><br \/>\nVCL\u306e\u8a2d\u5b9a\u306f\u4e21\u30d0\u30fc\u30b8\u30e7\u30f3\u3068\u3082\u3053\u306e\u3088\u3046\u306a\u611f\u3058\u3067\u3059<br \/>\n[code=&#8217;plain&#8217;]<br \/>\nbackend default {<br \/>\n  .host = &#8220;127.0.0.1&#8221;;<br \/>\n  .port = &#8220;80&#8221;;<br \/>\n}<br \/>\nsub vcl_fetch{<br \/>\nesi;<br \/>\n}<br \/>\n[\/code]<br \/>\n\u5358\u7d14\u306bESI\u3092\u3084\u308d\u3046\u3068\u3057\u3066\u308b\u3060\u3051\u3067\u3059\u306d<br \/>\n\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u8eab\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059<br \/>\n[code=&#8217;shell&#8217;]<br \/>\n[root@LIP-APP-03 html]# cat esi.html<br \/>\n<esi:include src=\"\/a.html\" \/><br \/>\n<esi:include src=\"\/b.html\" \/><\/p>\n<p>[root@LIP-APP-03 html]# cat a.html<br \/>\naaaaaaaaaaaaaaaaaaaaaaaaaaa<br \/>\n[root@LIP-APP-03 html]# cat b.html<br \/>\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb<br \/>\n[\/code]<\/p>\n<h4>2.0.6\u306e\u5834\u5408<\/h4>\n<p>[code=&#8217;shell&#8217;]<br \/>\n[root@LIP-APP-03 html]# time wget -d http:\/\/localhost:6081\/esi.html -O &#8211;<br \/>\nSetting &#8211;output-document (outputdocument) to &#8211;<br \/>\nDEBUG output created by Wget 1.11.4 Red Hat modified on linux-gnu.<\/p>\n<p>&#8211;2010-06-23 00:43:54&#8211;  http:\/\/localhost:6081\/esi.html<br \/>\nlocalhost \u3092DNS\u306b\u554f\u3044\u3042\u308f\u305b\u3066\u3044\u307e\u3059&#8230; 127.0.0.1<br \/>\nCaching localhost => 127.0.0.1<br \/>\nlocalhost|127.0.0.1|:6081 \u306b\u63a5\u7d9a\u3057\u3066\u3044\u307e\u3059&#8230; \u63a5\u7d9a\u3057\u307e\u3057\u305f\u3002<br \/>\nCreated socket 3.<br \/>\nReleasing 0x00000000159d1c20 (new refcount 1).<\/p>\n<p>&#8212;request begin&#8212;<br \/>\nGET \/esi.html HTTP\/1.0<br \/>\nUser-Agent: Wget\/1.11.4 Red Hat modified<br \/>\nAccept: *\/*<br \/>\nHost: localhost:6081<br \/>\nConnection: Keep-Alive<\/p>\n<p>&#8212;request end&#8212;<br \/>\nHTTP \u306b\u3088\u308b\u63a5\u7d9a\u8981\u6c42\u3092\u9001\u4fe1\u3057\u307e\u3057\u305f\u3001\u5fdc\u7b54\u3092\u5f85\u3063\u3066\u3044\u307e\u3059&#8230;<br \/>\n&#8212;response begin&#8212;<br \/>\nHTTP\/1.1 200 OK<br \/>\nServer: Apache\/2.2.3 (CentOS)<br \/>\nLast-Modified: Tue, 22 Jun 2010 15:11:30 GMT<br \/>\nETag: &#8220;630414-3d-4899fd6006c80&#8221;<br \/>\nContent-Type: text\/html; charset=UTF-8<br \/>\nDate: Tue, 22 Jun 2010 15:43:54 GMT<br \/>\nX-Varnish: 1443753876<br \/>\nAge: 0<br \/>\nVia: 1.1 varnish<br \/>\nConnection: keep-alive<\/p>\n<p>&#8212;response end&#8212;<br \/>\n200 OK<br \/>\n\u9577\u3055: \u7279\u5b9a\u3067\u304d\u307e\u305b\u3093 [text\/html]<br \/>\n`STDOUT&#8217; \u306b\u4fdd\u5b58\u4e2d<\/p>\n<p>    [<=>                                                                                                                                                                                                 ] 0           &#8211;.-K\/s              aaaaaaaaaaaaaaaaaaaaaaaaaaa<\/p>\n<p>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb<\/p>\n<p>    [      <=>                                                                                                                                                                                           ] 62          &#8211;.-K\/s \u6642\u9593 4.8s<\/p>\n<p>Closed fd 3<br \/>\n2010-06-23 00:43:59 (13.0 B\/s) &#8211; `-&#8216; \u3078\u4fdd\u5b58\u7d42\u4e86 [62]<\/p>\n<p>real    0m5.048s<br \/>\nuser    0m0.000s<br \/>\nsys     0m0.000s<\/p>\n<p>[\/code]<br \/>\nConnection: keep-alive\u306a\u306e\u306bcontent-length\u304c\u306a\u3044\u305f\u3081\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u5f85\u3063\u3066\u3057\u307e\u3063\u3066\u5927\u5909\u9045\u3044\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b<br \/>\n[code=&#8217;plain&#8217;]<br \/>\nsub vcl_deliver{<br \/>\n      set resp.http.Connection=&#8221;close&#8221;;<br \/>\n}<br \/>\n[\/code]<br \/>\n\u3068\u3044\u3063\u305f\u8a18\u8ff0\u3092VCL\u306b\u8ffd\u52a0\u3057\u305f\u3068\u3057\u3066\u3082\u4e00\u90e8\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3067\u306f\u3084\u3063\u3071\u308a\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8\u3092\u5f85\u3061\u307e\u3059<\/p>\n<h4>2.1.2\u306e\u5834\u5408<\/h4>\n<p>[code=&#8217;shell&#8217;]<\/p>\n<p>[root@LIP-APP-02 html]# time wget -d http:\/\/localhost:6081\/esi.html -O &#8211;<br \/>\nSetting &#8211;output-document (outputdocument) to &#8211;<br \/>\nDEBUG output created by Wget 1.11.4 Red Hat modified on linux-gnu.<\/p>\n<p>&#8211;2010-06-23 00:44:56&#8211;  http:\/\/localhost:6081\/esi.html<br \/>\nlocalhost \u3092DNS\u306b\u554f\u3044\u3042\u308f\u305b\u3066\u3044\u307e\u3059&#8230; 127.0.0.1<br \/>\nCaching localhost => 127.0.0.1<br \/>\nlocalhost|127.0.0.1|:6081 \u306b\u63a5\u7d9a\u3057\u3066\u3044\u307e\u3059&#8230; \u63a5\u7d9a\u3057\u307e\u3057\u305f\u3002<br \/>\nCreated socket 3.<br \/>\nReleasing 0x000000001cefcc20 (new refcount 1).<\/p>\n<p>&#8212;request begin&#8212;<br \/>\nGET \/esi.html HTTP\/1.0<br \/>\nUser-Agent: Wget\/1.11.4 Red Hat modified<br \/>\nAccept: *\/*<br \/>\nHost: localhost:6081<br \/>\nConnection: Keep-Alive<\/p>\n<p>&#8212;request end&#8212;<br \/>\nHTTP \u306b\u3088\u308b\u63a5\u7d9a\u8981\u6c42\u3092\u9001\u4fe1\u3057\u307e\u3057\u305f\u3001\u5fdc\u7b54\u3092\u5f85\u3063\u3066\u3044\u307e\u3059&#8230;<br \/>\n&#8212;response begin&#8212;<br \/>\nHTTP\/1.1 200 OK<br \/>\nServer: Apache\/2.2.3 (CentOS)<br \/>\nLast-Modified: Tue, 22 Jun 2010 15:21:01 GMT<br \/>\nETag: &#8220;858400-65-4899ff8093140&#8221;<br \/>\nContent-Type: text\/html; charset=UTF-8<br \/>\nDate: Tue, 22 Jun 2010 15:44:56 GMT<br \/>\nX-Varnish: 30445554<br \/>\nAge: 0<br \/>\nVia: 1.1 varnish<br \/>\nConnection: close<\/p>\n<p>&#8212;response end&#8212;<br \/>\n200 OK<br \/>\n\u9577\u3055: \u7279\u5b9a\u3067\u304d\u307e\u305b\u3093 [text\/html]<br \/>\n`STDOUT&#8217; \u306b\u4fdd\u5b58\u4e2d<\/p>\n<p>    [<=>                                                                                                                                                                                                                                                                          ] 0           &#8211;.-K\/s              aaaaaaaaaaaaaaaaaaaaaaaaaaa<\/p>\n<p>bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb<\/p>\n<p>00:44:56<\/p>\n<p>    [ <=>                                                                                                                                                                                                                                                                         ] 72          &#8211;.-K\/s \u6642\u9593 0.005s<\/p>\n<p>Closed fd 3<br \/>\n2010-06-23 00:44:56 (14.3 KB\/s) &#8211; `-&#8216; \u3078\u4fdd\u5b58\u7d42\u4e86 [72]<\/p>\n<p>real    0m0.010s<br \/>\nuser    0m0.000s<br \/>\nsys     0m0.004s<br \/>\n[\/code]<br \/>\nConnection: close\u306b\u5909\u308f\u3063\u3066\u3044\u307e\u3059\uff08\u3064\u307e\u308akeep-alive\u3067\u306f\u306a\u3044)<br \/>\n\u3082\u3061\u308d\u3093esi\u306e\u8a18\u8ff0\u304c\u306a\u3044\u30d5\u30a1\u30a4\u30eb\u306b\u3064\u3044\u3066\u306fkeep-alive\u304c\u6709\u52b9\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067<br \/>\ncontent-length\u3092\u8fd4\u5374\u3067\u304d\u306a\u3044\u30b1\u30fc\u30b9\uff08\u3064\u307e\u308aESI\uff09\u3067\u306fclose\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u307f\u305f\u3044\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u3084\u3063\u3068\u4f7f\u3044\u3084\u3059\u304f\u306a\u3063\u305f\u306a\u30fc\u3068\u500b\u4eba\u7684\u306b\u306f\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ee5\u524d\u66f8\u3044\u305f\u8a18\u4e8b\uff08Varnish\u3067ESI\u3092\u4f7f\u3046\u3068\u304d\u306e\u6ce8\u610f\u3059\u308b\u3079\u304d\u70b9\uff09\u3067 Keep-Alive\u306fOFF\u306b\u3059\u308b\u3079\u304d ESI\u4f7f\u7528\u6642\u306fcontent-length\u304c\u30d6\u30e9\u30a6\u30b6\u5074\u306b\u8fd4\u5374\u3055\u308c\u306a\u3044\u3088\u3046\u306a\u306e\u3067OFF\u306f\u307b\u307c\u5fc5\u9808\u3067\u3059 \u3069\u3046\u3057\u3066\u3082 <a href='https:\/\/blog.xcir.net\/?p=237' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[11,5,13,14],"class_list":["post-237","post","type-post","status-publish","format-standard","hentry","category-3","tag-esi","tag-varnish","tag-varnish2-0-6","tag-varnish2-1-2","category-3-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"_links":{"self":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=237"}],"version-history":[{"count":8,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":757,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/237\/revisions\/757"}],"wp:attachment":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}