varnish useful commands

Couple of notes on how to work with varnish:

starting command (highly relevant to my local setup):
sudo /usr/local/sbin/varnishd -a 127.0.0.1:81 -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000

VCL:
https://www.varnish-cache.org/docs/3.0/reference/vcl.html

connecting to CLI:
telnet 127.0.0.1 2000

purging/banning in CLI:
ban req.url == “/category/product.html”

check what was banned in CLI:
#https://www.varnish-cache.org/docs/3.0/reference/varnish-cli.html
ban.list

purging/banning via HTTP:
telnet domain.com 81
PURGE /category/product.html HTTP/1.0
Host: domain.com

 

Tagged on:

Leave a Reply