Ensure that your squid.conf includes the following configuration.
acl localhost src 127.0.0.1/32 ::1
acl manager proto cache_object
acl purge method PURGE
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access allow localhost purge
http_access deny manager
http_access deny purge
squidclient -m PURGE <URL that is cached when it shouldn't be>
E.g:
# squidclient -m PURGE http://mirror.aarnet.edu.au/pub/centos/7.9.2009/updates/x86_64/repodata/repomd.xml
HTTP/1.0 200 OK
Server: squid/m.n.pp
Mime-Version: 1.0
Date: Thu, 06 Oct 2022 02:05:16 GMT
Content-Length: 0
X-Cache: MISS from proxy.somewhere
X-Cache-Lookup: NONE from proxy.somewhere:3128
Via: 1.0 proxy.somewhere (squid/m.n.pp)
Connection: close
If the URL isn't in the cache, the return code will be 404 Not Found
instead of 200 OK
.
This was based on the info found on https://help.getbusi.com/article/43-removing-individual-objects-from-squid-cache