{"id":2658,"date":"2017-09-24T14:54:46","date_gmt":"2017-09-24T05:54:46","guid":{"rendered":"http:\/\/blog.xcir.net\/?p=2658"},"modified":"2017-09-24T14:54:46","modified_gmt":"2017-09-24T05:54:46","slug":"varnish5-2-0%e3%81%8c%e3%83%aa%e3%83%aa%e3%83%bc%e3%82%b9%e3%81%95%e3%82%8c%e3%81%be%e3%81%97%e3%81%9f","status":"publish","type":"post","link":"https:\/\/blog.xcir.net\/?p=2658","title":{"rendered":"Varnish5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f"},"content":{"rendered":"<p>VarnishCache5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u3002 [<a href=\"https:\/\/github.com\/varnishcache\/varnish-cache\/blob\/varnish-5.2.0\/doc\/changes.rst\">changelog<\/a>] [<a href=\"https:\/\/varnish-cache.org\/releases\/rel5.2.0.html#rel5-2-0\">\u516c\u5f0f\u306e\u30ea\u30ea\u30fc\u30b9\u6587<\/a>] [<a href=\"https:\/\/packagecloud.io\/varnishcache\/varnish52\">\u30d1\u30c3\u30b1\u30fc\u30b8DL<\/a>] [<a href=\"https:\/\/varnish-cache.org\/releases\/index.html\">\u30bd\u30fc\u30b9DL<\/a>]<br \/>\n\u30d0\u30b0\u306e\u4fee\u6b63\uff08\u7279\u306bh2\u95a2\u9023\u3067\u591a\u304f\u306e\u4fee\u6b63\u5165\u3063\u3066\u3044\u307e\u3059\uff09\u306f\u3082\u3061\u308d\u3093\u3067\u3059\u304c\u3001<br \/>\n\u65b0\u3057\u3044vmod\u304c\u63d0\u4f9b\u3055\u308c\u305f\u308a\u3001\u5f71\u97ff\u306e\u5927\u304d\u3044(\u7834\u58ca\u7684)\u5909\u66f4\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001VMOD\/TOOL\u958b\u767a\u8005\u5411\u3051\u306e\u5909\u66f4\u3082\u591a\u304f\u3001\u65b0\u3057\u3044\u30c4\u30fc\u30eb\u306a\u3069\u304c\u671f\u5f85\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u5f71\u97ff\u306e\u5927\u304d\u3044\u5909\u66f4<\/h3>\n<h4>VSM\u306e\u629c\u672c\u7684\u306a\u5909\u66f4<\/h4>\n<p>Varnish\u306e\u5185\u90e8\u3067\u30ed\u30b0\u3084\u7d71\u8a08\u306e\u4fdd\u5b58\u5148\u306b\u4f7f\u7528\u3057\u3066\u3044\u308bVSM\u306e\u4ed5\u7d44\u307f\u304c\u5909\u308f\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u306b\u3088\u308aVSM\u3092\u5229\u7528\u3057\u3066\u30ed\u30b0(VSL)\u3084\u7d71\u8a08(VSC)\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3044\u308b\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u3064\u3044\u3066\u306f\u5bfe\u5fdc\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u306a\u304a\u3001VSM\u306e\u30e9\u30c3\u30d1\u30fc\u3067\u3042\u308bVUT\u306b\u3064\u3044\u3066\u3082\u5909\u66f4\u304c\u3042\u308b\u306e\u3067\u3053\u308c\u95a2\u4fc2\u306f\u5168\u90e8\u4fee\u6b63\u304c\u5fc5\u8981\u3068\u8003\u3048\u3066\u3082\u5dee\u3057\u652f\u3048\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n(Varnish UTilities:VUT\u306fVSM\u3092\u4f7f\u3046\u4e0a\u3067log,ncsa\u7b49\u306e\u30b3\u30de\u30f3\u30c9\u3067\u6bce\u56de\u540c\u3058\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u306e\u304c\u9762\u5012\u3067\u307e\u3068\u3081\u3066\u308b\u9ad8\u30ec\u30d9\u30ebAPI\u3068\u601d\u3063\u3066\u3082\u3089\u3048\u308c\u3070\u9593\u9055\u3044\u306a\u3044\u3067\u3059)<\/p>\n<p>\u4f8b\u3048\u3070\u5f71\u97ff\u3092\u53d7\u3051\u308b\u3068\u3053\u308d\u3068\u3057\u3066\u306f<br \/>\n<a href=\"https:\/\/github.com\/phenomenes\/vago\">vago<\/a><br \/>\n<a href=\"https:\/\/github.com\/xcir\/python-varnishapi\">python-varnishapi<\/a><br \/>\n<a href=\"https:\/\/github.com\/wikimedia\/varnishkafka\">varnishkafka<\/a><br \/>\n\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u884c\u3046\u5834\u5408\u306f\u3001\u7279\u306b\u30ed\u30b0\u3001\u76e3\u8996\u5468\u308a\u306b\u3064\u3044\u3066\u6b63\u5e38\u306b\u52d5\u4f5c\u3059\u308b\u304b\u306a\u3069\u306e\u78ba\u8a8d\u3092\u884c\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h4>varnishstat\u306e\u51fa\u529b\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u5909\u66f4(-j\/-x)<\/h4>\n<p>\u4f8b\u3048\u3070munin\u306a\u3069\u306e\u76e3\u8996\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306e\u4e00\u90e8\u306fVarnish\u516c\u5f0f\u30b3\u30de\u30f3\u30c9\u7fa4\u306evarnishstat\u3092\u53e9\u3044\u3066\u7d71\u8a08\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4eca\u56devarnishstat\u306e-j(json)-x(xml)\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u51fa\u529b\u304b\u3089type, ident\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"brush: plain; \">\n\r\n~5.2.0(-j)\r\n  &quot;MAIN.uptime&quot;: {\r\n    &quot;description&quot;: &quot;Child process uptime&quot;,\r\n    &quot;type&quot;: &quot;MAIN&quot;, &quot;flag&quot;: &quot;c&quot;, &quot;format&quot;: &quot;d&quot;,\r\n    &quot;value&quot;: 4043809\r\n  },\r\n\r\n5.2.0~(-j)\r\n  &quot;MGT.uptime&quot;: {\r\n    &quot;description&quot;: &quot;Management process uptime&quot;,\r\n    &quot;flag&quot;: &quot;c&quot;, &quot;format&quot;: &quot;d&quot;,\r\n    &quot;value&quot;: 168192\r\n  },\r\n\n<\/pre>\n<p>\u305d\u306e\u305f\u3081\u305d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u52d5\u304b\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u81ea\u5206\u304c\u78ba\u8a8d\u3057\u305f\u9650\u308a\u3060\u3068munin\u306e<a href=\"https:\/\/github.com\/munin-monitoring\/contrib\/blob\/master\/plugins\/varnish\/varnish4_\">varnish4\u30d7\u30e9\u30b0\u30a4\u30f3<\/a>\u306b\u3064\u3044\u3066\u306f\u5f71\u97ff\u3092\u53d7\u3051\u3001\u4fee\u6b63\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>\u4e00\u90e8VSL\u30bf\u30b0\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u66f4<\/h4>\n<p>\u3053\u308c\u3082\u4e3b\u306b\u30c4\u30fc\u30eb\u3092\u4f5c\u3063\u3066\u308b\u4eba\u305f\u3061\u5411\u3051\u3067\u3059\u304c\uff08\u3082\u3057\u304f\u306fvarnishlog\u3067\u751f\u30ed\u30b0\u307f\u3066\u308b\u4eba\uff09<br \/>\n\u4e00\u90e8VSL\u30bf\u30b0\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u66f4\u3055\u308c\u3066\u304a\u308a\u3001\u305d\u306e\u305f\u3081\u30d1\u30fc\u30b9\u306b\u5931\u6557\u3059\u308b\u306a\u3069\u8d77\u3053\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>Hit, HitMiss, HitPass<\/strong><br \/>\n\u4eca\u307e\u3067\u306fVXID\u306e\u307f\u3067\u3057\u305f\u304c\u3001\u8ffd\u52a0\u3067\u6b8bTTL\u3092\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002(Hit\u306b\u3064\u3044\u3066\u306fgrace\/keepTTL\u3082\u51fa\u529b)<\/p>\n<p><strong>SessOpen<\/strong><br \/>\n\u7b2c3\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u306f\u4eca\u307e\u3067listen\u30bd\u30b1\u30c3\u30c8(-a\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5024)\u304c\u305d\u306e\u307e\u307e\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u304c\u3001<br \/>\n\u3053\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304b\u3089\u306f-a\u3067\u6307\u5b9a\u3055\u308c\u305f\u540d\u524d\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306fvarnish\u5074\u3067\u81ea\u52d5\u3067\u3064\u3051\u3089\u308c\u305f\u540d\u524d(a0\u306a\u3069)\u304c\u5165\u308a\u307e\u3059\u3002(\u5f8c\u8ff0\u3057\u307e\u3059)<\/p>\n<p><strong>VCL_trace<\/strong><br \/>\n\u65b0\u898f\u306bVCL\u306e\u540d\u524d\u3068source index\u3092\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3053\u308c\u306b\u3088\u308a\u3001\u4eca\u307e\u3067\u306fVCL\u306e\u3069\u3053\u3092\u901a\u904e\u3057\u305f\u304b\u3092\u5224\u65ad\u3059\u308b\u306e\u304c\u5272\u3068\u3081\u3093\u3069\u304f\u3055\u304b\u3063\u305f\u306e\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059<\/p>\n<pre class=\"brush: plain; \">\n\r\n10 VCL_trace      c boot 4 0.23.3\r\n                    |    | | |  |\r\n                    |    | | |  +- VCL program line position\r\n                    |    | | +---- VCL program line number\r\n                    |    | +------ VCL program source index\r\n                    |    +-------- VCL trace point index\r\n                    +------------- VCL configname\r\n\n<\/pre>\n<p>\u4f8b\u3048\u3070\u3053\u306e\u51fa\u529b\u306e\u5834\u5408\u3067\u3042\u308c\u3070<\/p>\n<pre class=\"brush: shell; \">\n\r\n# varnishadm vcl.show -v boot\r\n\n<\/pre>\n<p>\u3067\u51fa\u3066\u304d\u305fVCL\u304b\u3089<\/p>\n<pre class=\"brush: plain; \">\n\r\n\/\/ VCL.SHOW 0 939 \/etc\/varnish\/default2.vcl\r\n#           \u2191\u3053\u3053\u304csource index\u306b\u306a\u308b\r\n#\r\n# This is an example VCL file for Varnish.\r\n...\r\n\n<\/pre>\n<p>\u306e\u8a18\u8ff0\u3092\u63a2\u3057\u3066<\/p>\n<pre class=\"brush: plain; \">\n\r\n 22 sub vcl_deliver{\r\n 23   set resp.http.Hash = blob.encode(BASE64, blob=req.hash);\r\n      \u2191\u3053\u3053\r\n\n<\/pre>\n<p>line:23 pos:3\u3092\u3055\u304c\u3057\u307e\u3059<br \/>\n\u3053\u308c\u3067\u3069\u3053\u3092\u901a\u904e\u3057\u305f\u304b\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<h3>\u305d\u306e\u4ed6\u5909\u66f4<\/h3>\n<h4>varnishd\u306e\u5909\u66f4<\/h4>\n<p><b>-l\u3067vsm\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f<\/b><br \/>\n\u5148\u7a0b\u3082\u8ff0\u3079\u305f\u3068\u304a\u308avsm\u306e\u4ed5\u7d44\u307f\u304c\u5909\u308f\u3063\u305f\u5f71\u97ff\u3067\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a\u306f\u7121\u8996\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>-a\u3067\u540d\u524d\u304c\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f<\/strong><br \/>\nlisten\u30bd\u30b1\u30c3\u30c8\u306e\u540d\u524d\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002(-a admin=127.0.0.1:88\u306e\u5834\u5408\u3060\u3068\u540d\u524d\u304cadmin\u306b\u306a\u308b)<br \/>\n\u73fe\u6642\u70b9\u3067\u306f\u5148\u8ff0\u3057\u305fSessOpen\u306e\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5f71\u97ff\u3059\u308b\u7a0b\u5ea6\u3067\u3059\u3002<br \/>\n\u6b21\u30d0\u30fc\u30b8\u30e7\u30f3\u3078\u306e\u6e96\u5099\u3068\u601d\u3063\u3066\u3082\u3089\u3048\u308c\u3070\u826f\u3044\u304b\u3068\u3002<\/p>\n<h4>varnishstat\u306e\u5909\u66f4<\/h4>\n<p><b>MAIN.s_req\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f<\/b><br \/>\nMAIN.client_req\u3068\u540c\u3058\u306a\u306e\u3067\u3053\u3061\u3089\u3092\u898b\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046<\/p>\n<p><b>MAIN.req_dropped\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f<\/b><br \/>\nh2\u30b9\u30c8\u30ea\u30fc\u30e0\u304c\u62d2\u5426\u3055\u308c\u305f\u56de\u6570\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<h4>-N\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5ec3\u6b62<\/h4>\n<p>varnishlog,stat,ncsa,hist\u306b\u5b58\u5728\u3057\u305f-N\u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u5ec3\u6b62\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<h4>VCL\u306e\u5909\u66f4<\/h4>\n<p>\u5909\u6570\u306e\u8ffd\u52a0\u3084\u4e00\u90e8\u5909\u66f4\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u65e2\u5b58\u306e\u4fee\u6b63\u304c\u5fc5\u8981\u306b\u306a\u308b\u3088\u3046\u306a\u5909\u66f4\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u57fa\u672c\u7684\u306b\u306f5.1\u3067\u52d5\u3044\u3066\u3044\u305fVCL\u306f\u305d\u306e\u307e\u307e\u52d5\u304f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><strong>[\u52d5\u4f5c\u5909\u66f4]server.identity<\/strong><br \/>\n\u4ee5\u524d\u306f-n\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6307\u5b9a(def:\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d)\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3088\u308a-i\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5024\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u3082\u3057-i\u3067\u6307\u5b9a\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u30db\u30b9\u30c8\u540d(gethostname(3)\u306e\u7d50\u679c)\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>[\u8ffd\u52a0](req|bereq).hash<\/strong><br \/>\n\u73fe\u5728\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ad\u30fc\u30cf\u30c3\u30b7\u30e5\u3092BLOB\u51fa\u529b\u3057\u307e\u3059\u3002<br \/>\n\u5f8c\u8ff0\u3059\u308bvmod_blob\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u3067HEX\u3084BASE64\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059<\/p>\n<pre class=\"brush: plain; \">\n\r\nsub vcl_deliver {\r\n    # base64\u5f62\u5f0f\u3067\u30cf\u30c3\u30b7\u30e5\u3092\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u306b\u30bb\u30c3\u30c8\u3059\u308b\r\n    # Hash: ANTj5yFpZGjJsL0IaxEDGiG29h0fSZRvjywdvDkKihc=\r\n    # \u3053\u3093\u306a\u611f\u3058\u3067\u51fa\u529b\u3055\u308c\u308b\r\n    set resp.http.Hash = blob.encode(BASE64, blob=req.hash);\r\n}\r\n\n<\/pre>\n<p><strong>[\u8ffd\u52a0]bereq.is_bgfetch<\/strong><br \/>\nVarnish\u306e\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u3078\u306e\u30d5\u30a7\u30c3\u30c1\u306f2\u3064\u3042\u308a\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u7121\u3044\u306a\u3069\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u540c\u6642\u306b\u53d6\u5f97\u3057\u306b\u3044\u304ffetch\u3068grace\u306e\u52d5\u4f5c\u306a\u3069\u3067\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067fetch\u3092\u884c\u3046bgfetch\u304c\u5b58\u5728\u3057\u307e\u3059\u3002(<a href=\"http:\/\/blog.xcir.net\/?p=1564\">\u3053\u3053\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u66f4\u65b0<\/a>\u306b\u3064\u3044\u3066\u898b\u3066\u3082\u3089\u3048\u308c\u3070\u3069\u3093\u306a\u52d5\u304d\u3059\u308b\u304b\u308f\u304b\u308b\u3068\u601d\u3044\u307e\u3059)<br \/>\n\u4eca\u307e\u3067\u306fbackend_fetch\u306a\u3069\u306e\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30a2\u30af\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u4eca\u51e6\u7406\u3057\u3066\u3044\u308bfetch\u304c\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u51e6\u7406\u306a\u306e\u304b\u3092\u5224\u5b9a\u3059\u308b\u65b9\u6cd5\u306f\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u304c<br \/>\n\u3053\u306e\u5909\u6570\u3092\u4f7f\u3046\u3053\u3068\u306b\u3088\u3063\u3066\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\nbgfetch\u3092\u884c\u3063\u3066\u3044\u308b\u5834\u5408\u306ftrue\u304c\u5165\u308a\u307e\u3059\u3002\u307e\u305f\u8aad\u307f\u53d6\u308a\u5c02\u7528\u306a\u306e\u3067\u66f8\u304d\u8fbc\u307f\u306f\u51fa\u6765\u307e\u305b\u3093\u3002<\/p>\n<p><strong>[\u305d\u306e\u4ed6]req.backend_hint<\/strong><br \/>\n\u7279\u306b\u5909\u66f4\u3068\u3044\u3046\u308f\u3051\u3067\u306f\u306a\u3044\u3068\u601d\u3046\u3093\u3067\u3059\u304c<br \/>\nreq.backend_hint\u306erestart\u6642\u306e\u6319\u52d5\u304c\u660e\u8a18\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>vmod_std<\/h4>\n<p>\u65b0\u3057\u304f\u6307\u5b9a\u30d5\u30a1\u30a4\u30eb\u306e\u6709\u7121\u3092true\/false\u3067\u8fd4\u3059file_exists\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u3053\u306e\u95a2\u6570\u306fstd.fileread\u3068\u9055\u3044\u7d50\u679c\u306f\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u306a\u3044\u306e\u3067\u547c\u3073\u51fa\u3059\u3054\u3068\u306bstat\u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>vmod_blob<\/h4>\n<p>\u65b0\u3057\u304fvmod_blob\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u5b9f\u306f\u3042\u307e\u308a\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304cVCL\u306b\u306fBLOB\u578b\u3068\u3044\u3046\u306e\u304c\u5b58\u5728\u3057\u3066\u304a\u308a\u3001\u4e3b\u306bvmod\u9593\u3067\u306e\u30c7\u30fc\u30bf\u306e\u53d7\u3051\u6e21\u3057\u306a\u3069\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u306evmod_blob\u306fencode\/decode\u306a\u3069\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5bfe\u5fdc\u30a8\u30f3\u30b3\u30fc\u30c9\u306b\u306fbase64\/urlencode\u3082\u542b\u3093\u3067\u304a\u308a\u4fbf\u5229\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u3068\u308a\u3042\u3048\u305a\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070HEX\u8868\u8a18\u3055\u308c\u305ffoo(666F6F00)\u3092\u4e00\u65e6blob\u306b\u5909\u63db\u3057\u305f\u3042\u3068\u306bSTRING\u306b\u5909\u63db\u3057\u3066\u30d8\u30c3\u30c0\u306b\u5165\u308c\u308b\u5834\u5408\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; \">\n\r\nsub vcl_deliver{\r\n  set resp.http.foo = blob.encode(IDENTITY, blob=blob.decode(HEX, encoded=&quot;666F6F00&quot;));\r\n}\r\n\n<\/pre>\n<p>\u3053\u3053\u3067IDENTITY\u3084HEX\u304c\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059<br \/>\n\u3061\u306a\u307f\u306bblob.decode\/encode\u3092\u4f7f\u308f\u305a\u3068\u3082\u4e00\u6c17\u306b\u5909\u63db\u3059\u308btranscode\u3068\u3044\u3046\u3082\u306e\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u5148\u7a0b\u3068\u540c\u3058\u51fa\u529b\u3092\u5f97\u308b\u306b\u306f<\/p>\n<pre class=\"brush: plain; \">\n\r\nsub vcl_deliver{\r\n  set resp.http.foo = blob.transcode(encoding=IDENTITY, decoding=HEX, encoded=&quot;666F6F00&quot;);\r\n}\r\n\n<\/pre>\n<p>\u3067\u3082\u51fa\u6765\u307e\u3059\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u5bfe\u5fdc\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u3067\u3059\u3002<\/p>\n<ul>\n<li>IDENTITY<\/li>\n<li>BASE64<\/li>\n<li>BASE64URL<\/li>\n<li>BASE64URLNOPAD<\/li>\n<li>HEX<\/li>\n<li>URL<\/li>\n<\/ul>\n<p>BASE64\u3068\u304bURL(URL\u30a8\u30f3\u30b3\u30fc\u30c9)\u306f\u307f\u305f\u307e\u3093\u307e\u306a\u306e\u3067\u7279\u306b\u89e3\u8aac\u306f\u3044\u3089\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nIDENTITY\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306f\u7279\u306b\u4f55\u3089\u304b\u306e\u30a8\u30f3\u30b3\u30fc\u30c9\u304c\u3055\u308c\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u5165\u529b\u3055\u308c\u305f\u5024\u305d\u306e\u307e\u307e\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u5148\u7a0b\u306e\u4f8b\u3067666F6F00\u3092\u51fa\u529b\u3057\u305f\u5834\u5408\u306ffoo\u306b\u306a\u3063\u305f\u308f\u3051\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306bHEX\u5f62\u5f0f\u306e\u5148\u982d\u306b\u306f0x\u306f\u4e0d\u8981\u3067\u3059\u306e\u3067\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u8a73\u3057\u3044\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u306f<a href=\"https:\/\/varnish-cache.org\/docs\/trunk\/reference\/vmod_blob.generated.html\">\u3053\u3061\u3089\u3092\u53c2\u7167<\/a>\u304f\u3060\u3055\u3044<\/p>\n<h4>vmod_purge<\/h4>\n<p>\u7d44\u307f\u8fbc\u307f\u306epurge\u3092\u3088\u308a\u67d4\u8edf\u306b\u4f7f\u3046\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<br \/>\n\u3061\u306a\u307f\u306b\u65e2\u5b58\u306ereturn(purge)\u304c\u306a\u304f\u306a\u3063\u305f\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u306a\u304a\u4ee5\u4e0b\u306e\u95a2\u6570\u306f\u3059\u3079\u3066vcl_hit\/vcl_miss\u3067\u306e\u307f\u547c\u3073\u51fa\u3057\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><strong>INT purge.hard()<\/strong><br \/>\nreturn(purge)\u3068\u540c\u3058\u6319\u52d5\u3092\u3057\u307e\u3059\u3002\uff08\u4eca\u306e\u30cf\u30c3\u30b7\u30e5\u3068\u4e00\u81f4\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6d88\u3059\uff09<br \/>\n\u623b\u308a\u5024\u306f\u6d88\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6570\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>INT purge.soft(DURATION ttl=0, DURATION grace=-1, DURATION keep=-1)<\/strong><br \/>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u5834\u5408\u306fTTL\u30920\u306b\u3057\u307e\u3059\u3002\u305f\u3060\u3057grace\u3084keep\u306f\u5909\u66f4\u3057\u307e\u305b\u3093(-1)<br \/>\n\u3061\u306a\u307f\u306bhard()\u306fsoft(0,0,0)\u3068\u540c\u3058\u3067\u3059\u3002<br \/>\n\u307e\u3041\u3001\u65e2\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eTTL,grace,keep\u3092\u81ea\u7531\u306b\u3044\u3058\u308b\u306e\u306b\u4f7f\u3048\u308b\u3068\u601d\u3063\u3066\u3082\u3089\u3048\u308c\u3070\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u306a\u304a\u623b\u308a\u5024\u306f\u64cd\u4f5c\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u6570\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h4>vmod_vtc<\/h4>\n<p>\u3053\u308c\u306f\u5143\u3005vmod\u4f5c\u8005\u304c\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3059\u308b\u969b\u306b\u4fbf\u5229\u306b\u4f7f\u3048\u308b\u3082\u306e\u3067\u3059\u3002<br \/>\n\u5b50\u30d7\u30ed\u30bb\u30b9\u3092panic\u3055\u305b\u305f\u308a\u3059\u308b\u95a2\u6570\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u901a\u5e38\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u4f7f\u3046\u3082\u306e\u3067\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30d0\u30b0\u4fee\u6b63<\/h3>\n<p>\u591a\u304f\u306e\u30d0\u30b0\u304c\u4fee\u6b63\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u305d\u3053\u307e\u3067\u89e6\u308c\u307e\u305b\u3093\u304c1\u70b9\u3060\u3051\u30fb\u30fb\u30fb<br \/>\nhttp\/2\u306b\u304a\u3044\u3066\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306e\u30d0\u30b0\u304c\u4fee\u6b63\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4eca\u306e\u3068\u3053\u308d\u8a72\u5f53\u30d1\u30c3\u30c1\u304c\u5f53\u305f\u3063\u3066\u304b\u3089\u4e00\u6708\u4ee5\u4e0a\u7a3c\u50cd\u3055\u305b\u3066\u3044\u307e\u3059\u304c\u3001\u5b89\u5b9a\u52d5\u4f5c\u3057\u3066\u304a\u308a\u307e\u3059\u3002<br \/>\n\u307e\u3060experimental\u306a\u306e\u3067\u4eba\u67f1\u899a\u609f\u3068\u306f\u3044\u3048\u666e\u901a\u306b\u4f7f\u3048\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u6b21\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3064\u3044\u3066<\/h3>\n<p>\u6b21\u306e\u5927\u578b\u30ea\u30ea\u30fc\u30b9\u306f2018\u5e743\u6708\u4e88\u5b9a\u3067\u3059\u3002<br \/>\n\u5b9f\u306f\u5143\u3005\u4eca\u56de\u306f\u30e1\u30b8\u30e3\u30fc\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u304c\u4e88\u5b9a\u3055\u308c\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u4e88\u5b9a\u30ea\u30ea\u30fc\u30b9\u65e5\u306b\u9593\u306b\u5408\u308f\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u4e00\u90e8\u5206\u3092\u5207\u308a\u51fa\u3057\u30665.2\u3067\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u306a\u306e\u3067\u65e2\u306b\u6b21\u671f\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\u7247\u9c57\u306fpr\u306a\u3069\u306b\u3042\u308b\u306e\u3067\u3059\u304c(\u4f8b\u3048\u3070<a href=\"https:\/\/github.com\/varnishcache\/varnish-cache\/pull\/2371\">UDS\u5bfe\u5fdc<\/a>)\u306a\u304b\u306a\u304b\u304a\u3082\u3057\u308d\u3044\u6a5f\u80fd\u304c\u5897\u3048\u305f\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u306a\u308a\u305d\u3046\u3067\u3001\u500b\u4eba\u7684\u306b\u306f\u697d\u3057\u307f\u306b\u3057\u3066\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%3D2658&title=Varnish5.2.0%E3%81%8C%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9%E3%81%95%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F' 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=2658' title='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - Varnish5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f' rel=nofollow class='wp_social_bookmarking_light_a' target=_blank><img src='\/\/b.hatena.ne.jp\/entry\/image\/https:\/\/blog.xcir.net\/?p=2658' alt='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - Varnish5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f' title='\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af - Varnish5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f'   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%3D2658&t=Varnish5.2.0%E3%81%8C%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9%E3%81%95%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F' 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%3D2658&title=Varnish5.2.0%E3%81%8C%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9%E3%81%95%E3%82%8C%E3%81%BE%E3%81%97%E3%81%9F' 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=2658\" data-text=\"Varnish5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\" data-lang=\"ja\">Tweet<\/a><\/div><\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>VarnishCache5.2.0\u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u3002 [changelog] [\u516c\u5f0f\u306e\u30ea\u30ea\u30fc\u30b9\u6587] [\u30d1\u30c3\u30b1\u30fc\u30b8DL] [\u30bd\u30fc\u30b9DL] \u30d0\u30b0\u306e\u4fee\u6b63\uff08\u7279\u306bh2\u95a2\u9023\u3067\u591a\u304f\u306e\u4fee\u6b63\u5165\u3063\u3066\u3044\u307e\u3059\uff09\u306f\u3082\u3061\u308d\u3093\u3067\u3059\u304c\u3001 \u65b0\u3057\u3044vm <a href='https:\/\/blog.xcir.net\/?p=2658' 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":[5,82,32],"class_list":["post-2658","post","type-post","status-publish","format-standard","hentry","category-3","tag-varnish","tag-varnish5-2-0","tag-32","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\/2658","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=2658"}],"version-history":[{"count":24,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/2658\/revisions"}],"predecessor-version":[{"id":2682,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=\/wp\/v2\/posts\/2658\/revisions\/2682"}],"wp:attachment":[{"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.xcir.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}