Squid and sites that can’t be cached
I had a particular web application today that wasn’t working through the default RH Squid install, plus transparent proxying. Symptom:
- Open browser (IE), open the given URL, get login page
- Login
- Close all browser windows (not logging out of the web application)
- Open new browser window, open the given URL, get 500 server error
First I tried removing the objects from the
cache. On this
RH 8.0 box, squidclient was called just client:
[root@gateway root]# /usr/sbin/client -m PURGE -h 127.0.0.1 http://offending/url
HTTP/1.0 200 OK
Server: Squid/2.4.STABLE7
Mime-Version: 1.0
Date: Wed, 18 Jan 2006 23:53:13 GMT
Content-Length: 0
X-Cache: MISS from gateway
Proxy-Connection: close
[root@gateway root]#
This made the 500 go away, until someone else logged in. Then everyone (except the logged in person, I think) would get 500 errors again. So then I tried forcing Squid to go direct for the site in question. This didn’t work either.
Finally, I read the FAQ on not caching
anything and
used the no_cache directive with the ACL I created when trying
always_direct. Then I had to make sure to clean out (using the
above method) any cached pages from that site. Then I apparently had
to do a service squid restart. Finally, the site seems to work
normally.