varnish

varnish でuser-agent(のグループ) ごとにキャッシュする

これメモってた気がするんだけど、検索してもひっかからなかったし だいぶ更新放置しているので久々に書く。 https://www.varnish-cache.org/docs/3.0/tutorial/devicedetection.html 同一URLでもアプリケーションによってPC/スマートフォン/ガラケー などで…

varnish のparameter 見るコマンド

ちょいちょい忘れる。 # varnishadm param.show

varnishでbackendのapacheにPOSTしているときにたまに(1/1000ぐらい)503 Service Unavailable になる現象はpassをpipeに変えたら出なくなった

https://www.varnish-cache.org/lists/pipermail/varnish-misc/2011-March/020169.html これも同じような感じ? backendの設定とbackendに投げる設定のvclはこんな感じ(抜粋) backend probe healthcheck { .url = "/index.html"; .interval = 30s; .timeout …

varnish でredirectする

https://www.varnish-cache.org/trac/wiki/RedirectsAndRewrites http://d.hatena.ne.jp/hogem/20100731/1280509514 Varnish does not have any built in support for HTTP redirections so redirection in Varnish can only be accomplished using somethin…

varnish のアクセスログをvarnishncsaでvirtualhostごとにログを取る

twitterでつぶやいてたら@xcir さんから回答もらった。 @xcir: @hogem varnishncsa -m "RxHeader:^Host: ホスト名$"とかで絞り込むのはどうでしょうか?2012-03-20 00:40:55 via web to @hogem http://blog.xcir.net/index.php/2012/03/varnishncsa%E3%81%A7…

varnish - varnishncsaのアクセスログ

最近のバージョンは-F でformatを指定できるようになったけど、URLによってのアクセスログoff/on など柔軟に対応できないぽいのでnginx をfrontに置いてしまったほうが楽? defaultのformatは'%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" %{Varn…

varnishのcacheを破棄する方法

https://www.varnish-cache.org/docs/3.0/tutorial/vcl.html PURGEメソッドが呼ばれるとそのURLのcacheを破棄するように設定する例。aclでアクセス制限をすると良い。 # Who is allowed to purge.... acl local { "localhost"; "192.168.1.0"/24; /* and eve…

varnish - vclのdebug

default.vcl import std; sub vcl_recv { std.log("hoge " + req.url); } 例えばこういうvclを設定して、http://varnishe.example.com/foo/bar/ にアクセスするとvarnishlog 中に 7 VCL_Log c hoge /foo/bar/ と表示される。

varnish cacheでコンテンツのキャッシュ

varnish cache リバースプロキシ専用サーバ。キャッシュルールを細かく設定できるので、色々使えそうだし勉強がてら遊んでみた。 http://varnish-cache.org/wiki/Introduction http://varnish-cache.org/docs/ http://d.hatena.ne.jp/keita_yamaguchi/200801…