{"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<\/p>\n<pre class=\"brush: plain; \">\n\r\nbackend default {\r\n  .host = &quot;127.0.0.1&quot;;\r\n  .port = &quot;80&quot;;\r\n}\r\nsub vcl_fetch{\r\nesi;\r\n}\r\n\n<\/pre>\n<p>\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<\/p>\n<pre class=\"brush: shell; \">\n\r\n[root@LIP-APP-03 html]# cat esi.html\r\n&lt;esi:include src=&quot;\/a.html&quot; \/&gt;\r\n&lt;esi:include src=&quot;\/b.html&quot; \/&gt;\r\n\r\n[root@LIP-APP-03 html]# cat a.html\r\naaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n[root@LIP-APP-03 html]# cat b.html\r\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\r\n\n<\/pre>\n<h4>2.0.6\u306e\u5834\u5408<\/h4>\n<pre class=\"brush: shell; \">\n\r\n[root@LIP-APP-03 html]# time wget -d http:\/\/localhost:6081\/esi.html -O -\r\nSetting --output-document (outputdocument) to -\r\nDEBUG output created by Wget 1.11.4 Red Hat modified on linux-gnu.\r\n\r\n--2010-06-23 00:43:54--  http:\/\/localhost:6081\/esi.html\r\nlocalhost \u3092DNS\u306b\u554f\u3044\u3042\u308f\u305b\u3066\u3044\u307e\u3059... 127.0.0.1\r\nCaching localhost =&gt; 127.0.0.1\r\nlocalhost|127.0.0.1|:6081 \u306b\u63a5\u7d9a\u3057\u3066\u3044\u307e\u3059... \u63a5\u7d9a\u3057\u307e\u3057\u305f\u3002\r\nCreated socket 3.\r\nReleasing 0x00000000159d1c20 (new refcount 1).\r\n\r\n---request begin---\r\nGET \/esi.html HTTP\/1.0\r\nUser-Agent: Wget\/1.11.4 Red Hat modified\r\nAccept: *\/*\r\nHost: localhost:6081\r\nConnection: Keep-Alive\r\n\r\n---request end---\r\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...\r\n---response begin---\r\nHTTP\/1.1 200 OK\r\nServer: Apache\/2.2.3 (CentOS)\r\nLast-Modified: Tue, 22 Jun 2010 15:11:30 GMT\r\nETag: &quot;630414-3d-4899fd6006c80&quot;\r\nContent-Type: text\/html; charset=UTF-8\r\nDate: Tue, 22 Jun 2010 15:43:54 GMT\r\nX-Varnish: 1443753876\r\nAge: 0\r\nVia: 1.1 varnish\r\nConnection: keep-alive\r\n\r\n---response end---\r\n200 OK\r\n\u9577\u3055: \u7279\u5b9a\u3067\u304d\u307e\u305b\u3093 [text\/html]\r\n`STDOUT&#039; \u306b\u4fdd\u5b58\u4e2d\r\n\r\n    [&lt;=&gt;                                                                                                                                                                                                 ] 0           --.-K\/s              aaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n\r\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\r\n\r\n\r\n    [      &lt;=&gt;                                                                                                                                                                                           ] 62          --.-K\/s \u6642\u9593 4.8s\r\n\r\nClosed fd 3\r\n2010-06-23 00:43:59 (13.0 B\/s) - `-&#039; \u3078\u4fdd\u5b58\u7d42\u4e86 [62]\r\n\r\n\r\nreal    0m5.048s\r\nuser    0m0.000s\r\nsys     0m0.000s\r\n\r\n\n<\/pre>\n<p>Connection: 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<\/p>\n<pre class=\"brush: plain; \">\n\r\nsub vcl_deliver{\r\n      set resp.http.Connection=&quot;close&quot;;\r\n}\r\n\n<\/pre>\n<p>\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<pre class=\"brush: shell; \">\n\r\n\r\n\r\n[root@LIP-APP-02 html]# time wget -d http:\/\/localhost:6081\/esi.html -O -\r\nSetting --output-document (outputdocument) to -\r\nDEBUG output created by Wget 1.11.4 Red Hat modified on linux-gnu.\r\n\r\n--2010-06-23 00:44:56--  http:\/\/localhost:6081\/esi.html\r\nlocalhost \u3092DNS\u306b\u554f\u3044\u3042\u308f\u305b\u3066\u3044\u307e\u3059... 127.0.0.1\r\nCaching localhost =&gt; 127.0.0.1\r\nlocalhost|127.0.0.1|:6081 \u306b\u63a5\u7d9a\u3057\u3066\u3044\u307e\u3059... \u63a5\u7d9a\u3057\u307e\u3057\u305f\u3002\r\nCreated socket 3.\r\nReleasing 0x000000001cefcc20 (new refcount 1).\r\n\r\n---request begin---\r\nGET \/esi.html HTTP\/1.0\r\nUser-Agent: Wget\/1.11.4 Red Hat modified\r\nAccept: *\/*\r\nHost: localhost:6081\r\nConnection: Keep-Alive\r\n\r\n---request end---\r\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...\r\n---response begin---\r\nHTTP\/1.1 200 OK\r\nServer: Apache\/2.2.3 (CentOS)\r\nLast-Modified: Tue, 22 Jun 2010 15:21:01 GMT\r\nETag: &quot;858400-65-4899ff8093140&quot;\r\nContent-Type: text\/html; charset=UTF-8\r\nDate: Tue, 22 Jun 2010 15:44:56 GMT\r\nX-Varnish: 30445554\r\nAge: 0\r\nVia: 1.1 varnish\r\nConnection: close\r\n\r\n---response end---\r\n200 OK\r\n\u9577\u3055: \u7279\u5b9a\u3067\u304d\u307e\u305b\u3093 [text\/html]\r\n`STDOUT&#039; \u306b\u4fdd\u5b58\u4e2d\r\n\r\n    [&lt;=&gt;                                                                                                                                                                                                                                                                          ] 0           --.-K\/s              aaaaaaaaaaaaaaaaaaaaaaaaaaa\r\n\r\nbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\r\n\r\n00:44:56\r\n\r\n\r\n    [ &lt;=&gt;                                                                                                                                                                                                                                                                         ] 72          --.-K\/s \u6642\u9593 0.005s\r\n\r\nClosed fd 3\r\n2010-06-23 00:44:56 (14.3 KB\/s) - `-&#039; \u3078\u4fdd\u5b58\u7d42\u4e86 [72]\r\n\r\n\r\nreal    0m0.010s\r\nuser    0m0.000s\r\nsys     0m0.004s\r\n\n<\/pre>\n<p>Connection: 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<div class='wp_social_bookmarking_light'>        <div class=\"wsbl_hatena\"><a href='\/\/b.hatena.ne.jp\/add?mode=confirm&url=https%3A%2F%2Fblog.xcir.net%2F%3Fp%3D237&title=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%A6%28Varnish2.0.6%E3%81%A8%E6%AF%94%E8%BC%83%E3%81%97%E3%81%A6%EF%BC%89' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/blog.xcir.net\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/hatena.gif' alt='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' title='\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0' width='16' height='12' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_hatena_users\"><a href='\/\/b.hatena.ne.jp\/entry\/https:\/\/blog.xcir.net\/?p=237' title='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - 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' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='\/\/b.hatena.ne.jp\/entry\/image\/https:\/\/blog.xcir.net\/?p=237' alt='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - 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' title='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - 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'   class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_facebook\"><a href='http:\/\/www.facebook.com\/share.php?u=https%3A%2F%2Fblog.xcir.net%2F%3Fp%3D237&t=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%A6%28Varnish2.0.6%E3%81%A8%E6%AF%94%E8%BC%83%E3%81%97%E3%81%A6%EF%BC%89' title='Facebook \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/blog.xcir.net\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/facebook.png' alt='Facebook \u306b\u30b7\u30a7\u30a2' title='Facebook \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_linkedin\"><a href='\/\/www.linkedin.com\/shareArticle?mini=true&url=https%3A%2F%2Fblog.xcir.net%2F%3Fp%3D237&title=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%A6%28Varnish2.0.6%E3%81%A8%E6%AF%94%E8%BC%83%E3%81%97%E3%81%A6%EF%BC%89' title='LinkedIn \u306b\u30b7\u30a7\u30a2' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='https:\/\/blog.xcir.net\/wp-content\/plugins\/wp-social-bookmarking-light\/public\/images\/linkedin.png' alt='LinkedIn \u306b\u30b7\u30a7\u30a2' title='LinkedIn \u306b\u30b7\u30a7\u30a2' width='16' height='16' class='wp_social_bookmarking_light_img' \/><\/a><\/div>        <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/blog.xcir.net\/?p=237\" data-text=\"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\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\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}]}}