NC远程通过PURGE清除Squid缓存

1、squid配置PURGE权限:

        复制,增加ip就行

acl Admin src 127.0.0.1  192.168.16.100 192.168.16.234
acl Purge method PURGE
http_access allow Admin Purge
http_access deny Purge

2、远程执行:

echo "PURGE http://www.perofu.com/aa.html" | nc 192.168.16.100 1010

3、测试:

[1015][root@www: /root]# curl -I http://www.perofu.com/aa.html
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 06 Jan 2017 06:22:39 GMT
Content-Type: text/html
Connection: keep-alive
Content-Length: 4
Last-Modified: Thu, 05 Jan 2017 03:02:25 GMT
ETag: "586db741-4"
Accept-Ranges: bytes
Age: 17540
X-Cache: HIT from localhost

[1016][root@www: /root]# echo "PURGE http://www.perofu.com/aa.html" | nc 192.168.16.100 1010
HTTP/1.0 200 OK
Server: squid/2.6.STABLE20
Date: Fri, 06 Jan 2017 06:22:42 GMT
Content-Length: 0

[1017][root@www: /root]#
[1017][root@www: /root]# curl -I http://www.perofu.com/aa.html                              
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 06 Jan 2017 06:22:44 GMT
Content-Type: text/html
Connection: keep-alive
Content-Length: 4
Last-Modified: Thu, 05 Jan 2017 03:02:25 GMT
ETag: "586db741-4"
Accept-Ranges: bytes
X-Cache: MISS from localhost

4、附清理squid效果:


 

转载于:https://my.oschina.net/fufangchun/blog/819925

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值