ProdigYu's Blog

CDN

Squid清除缓存脚本

by ProdigYu on May.13, 2011, under CDN

转自张宴的《清除指定squid缓存文件的脚本》
脚本文件名:clear_squid_cache.sh

#!/bin/sh
squidcache_path="/cache"
squidclient_path="/usr/local/squid/bin/squidclient"
grep -a -r $1 $squidcache_path/* | strings | grep "http:" | awk -F'http:' '{print "http:"$2;}' > cache_list.txt
for url in `cat cache_list.txt`; do
$squidclient_path -m PURGE -p 80 $url
done

  注意:请赋予clear_squid_cache.sh可执行权限(命令:chmod +x ./clear_squid_cache.sh)。请确保脚本所在目录可写。

  设置:
  squidcache_path= 表示squid缓存目录的路径
  squidclient_path= 表示squidclient程序所在的路径,默认为squid安装目录下的bin/squidclient

  用法:
  1、清除所有Flash缓存(扩展名.swf):
  ./clear_squid_cache.sh swf

  2、清除URL中包含prodigyu.com的所有缓存:
  ./clear_squid_cache.sh prodigyu.com

  3、清除文件名为prodigyu.jpg的所有缓存:
  ./clear_squid_cache.sh prodigyu.jpg

65 Comments :, , , more...

用Bind9架设自己的智能DNS

by ProdigYu on Oct.20, 2010, under CDN

中国的南北网络问题,是许多做网站的人的心病
除了使用双通或者多通机房以外,还可以通过多台镜像服务器的方法来提高用户的访问速度 (continue reading…)

Leave a Comment :, more...

使用Bind 9 的DNS-views实现IP地址分区域解析

by ProdigYu on Oct.20, 2010, under CDN

最近着手准备CDN节点了,得多看点资料. (continue reading…)

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...