Ban url does not work
Zeeshan Ali Shah
zeeshan at infoshield.info
Thu Aug 2 00:54:15 CEST 2012
Found this working ..
#!/bin/bash
cmd="sudo varnishadm -T 127.0.0.1:6082 -S /etc/varnish/secret"
site="www.xyz.com"
pages="
/
/feed/
/feed/atom/
"
echo -----------------------------
echo Purging old pages from cache
echo -----------------------------
#for page in $pages; do
# $cmd ban.url "^$page\$" | sed '/^$/d'
#$cmd ban.url "$site$page\$" | sed '/^$/d'
$cmd ban req.http.host == "$site"
$cmd ban.list | head -n 1
#done
echo ---------------------------------------
echo Populating cache with new page content
echo ---------------------------------------
#for page in $pages; do
# Remove for loop in case of single site
curl -sL -w "%{http_code} %{url_effective}\n" $site -o /dev/null
#done
On Wed, Aug 1, 2012 at 10:04 PM, Zeeshan Ali Shah
<zeeshan at infoshield.info>wrote:
> Hi, I tried ban instead of purge since it is obsolete in 3 but still data
> coming old . any hint ? i used the script from below
>
> BR
>
> Zeeshan
>
> v-purge-common
>
> #!/bin/bash
>
> cmd="sudo varnishadm -T 127.0.0.1:6082 -S /etc/varnish/secret"
> site="http://www.xyx.com"
> pages="
> /
> /feed/
> /feed/atom/
> "
>
> echo -----------------------------
> echo Purging old pages from cache
> echo -----------------------------
> for page in $pages; do
> # $cmd ban.url "^$page\$" | sed '/^$/d'
> $cmd ban.url "$site$page\$" | sed '/^$/d'
> $cmd ban.list | head -n 1
> done
>
> echo ---------------------------------------
> echo Populating cache with new page content
> echo ---------------------------------------
> for page in $pages; do
> curl -sL -w "%{http_code} %{url_effective}\n" $site/$page -o /dev/null
> done
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20120802/ae2d7454/attachment-0001.html>
More information about the varnish-misc
mailing list