闲来无事,折腾折腾:
# cat clearcache.sh #!/bin/shclean_cache(){/usr/local/varnish/bin/varnishadm -T 127.0.0.1:6082 ban "req.http.host ~ $domain$ && req.url ~ $url$"return}read -p "Enter you domain name(Example:www.example.com):" domainread -p "Enter you URL:" urlif clean_cache domain url;then echo "cache is clean,now URL is update"else echo "URL clean faild"fi
执行:
# ./clearcache Enter you domain name(Example:www.example.com):www.xueui.cnEnter you URL:/download/ps-plug/ps-remove-unused-fx.htmlcache is clean,now URL is update
原文地址:varnish清url缓存的shell, 感谢原作者分享。 享受每一刻的感觉,欣赏每一处的风景,这就是人生。