侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

NC远程通过PURGE清除Squid缓存

2023-12-01 星期五 / 0 评论 / 0 点赞 / 64 阅读 / 2060 字

1、squid配置PURGE权限: 复制,增加ip就行 acl Admin src 127.0.0.1 192.168.16.100 192.168.16.234 acl Purg

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效果:


 

广告 广告

评论区