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://static.oschina.net/uploads/space/2017/0106/143527_GpTi_727880.png)
转载于:https://my.oschina.net/fufangchun/blog/819925