本文共 1553 字,大约阅读时间需要 5 分钟。
$ varnishstator$ varnishstat -n /var/lib/varnish/atom-netkiller/
HTTP Head
$ curl -I http://bg7nyt.mooo.com/HTTP/1.1 404 Not FoundX-Powered-By: PHP/5.2.6-3ubuntu4.2Content-type: text/htmlServer: lighttpd/1.4.19Content-Length: 539Date: Wed, 23 Sep 2009 00:05:11 GMTX-Varnish: 938430316Age: 0Via: 1.1 varnishConnection: keep-alive
test gzip,defalte
$ curl -H Accept-Encoding:gzip,defalte -I http://bg7nyt.mooo.com/HTTP/1.1 200 OKX-Powered-By: PHP/5.2.6-3ubuntu4.2Content-Encoding: gzipVary: Accept-EncodingContent-type: text/htmlServer: lighttpd/1.4.19Date: Wed, 23 Sep 2009 00:08:51 GMTX-Varnish: 938430335Age: 0Via: 1.1 varnishConnection: keep-alive
help messages
$ varnishadm -T 127.0.0.1:6082 helphelp [command]ping [timestamp]statusstartstopstatsvcl.loadvcl.inline vcl.use vcl.discard vcl.listvcl.show param.show [-l] [ ]param.set quitpurge.url purge.hash purge [&& ]...purge.list
通过Varnish管理端口,使用正则表达式批量清除缓存:
清除所有缓存
/usr/local/varnish/bin/varnishadm -T 127.0.0.1:6082 url.purge *$
http://bg7nyt.mooo.com/zh-cn/technology/news.html 清除类/zh-cn/下所有缓存
/usr/local/varnish/bin/varnishadm -T 127.0.0.1:6082 url.purge /zh-cn/
/usr/local/varnish/bin/varnishadm -T 127.0.0.1:3500 url.purge w*$
varnishtop -i rxurlvarnishtop -i txurlvarnishtop -i RxHeader -I Accept-Encoding
原文出处:Netkiller 系列 手札
本文作者:陈景峯 转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。