[squid-users] Reverse proxy TCP_MISSes for cached pages from different client IPs

From: goran kent <gorankent_at_gmail.com>
Date: Tue, 18 Oct 2011 20:02:36 +0200

Hi,

Using squid 2.6.STABLE21 on CentOS 5.x as a reverse proxy.

For our application caching URLs with "/?q=" in it is vital for
performance. In other words, irrespective of client IP or client
cache settings (or even origin server cache control), etc, any URL
with "/?q=" in it *must* be cached permanently and served to any and
all clients (until we refresh it manually).

The problem I'm having is that clientA will browse to eg,
"test.com/?q=a" and it will be cached successfully. However, clientB
or clientC, etc, browsing to the same URL ("test.com/?q=a" in this
case), will not always be served from the cache. Instead, and I've
been unsuccessfully trying to isolate why, squid will go direct and
re-fetch it from the origin server, even though the page in the cache
is only a few seconds old.

Here's the log:

ip.of.my.desktop TCP_MISS/200 3211 GET http://test.com/?q=minors -
FIRST_UP_PARENT/myAccel text/html
ip.of.client.A TCP_MISS/200 3258 GET http://test.com/?q=minors -
FIRST_UP_PARENT/myAccel text/html
ip.of.client.B TCP_MISS/200 3206 GET http://test.com/?q=minors -
FIRST_UP_PARENT/myAccel text/html

Browsing again to the same URL with clientA yields a hit:

ip.of.client.A TCP_MEM_HIT/200 3214 GET http://test.com/?q=minors -
NONE/- text/html

So, it's almost like caching is tied to the client IP, and not based
solely on the cached URL, which is what I would expect for reverse
proxying.

I'd appreciate any comments/suggestions on what I'm missing.

Thanks
Henry

My config:

http_port 80 accel defaultsite=test.com
cache_peer directtest.com parent 80 0 no-query originserver name=myAccel
acl our_sites dstdomain test.com
acl all src 0.0.0.0/0.0.0.0
http_access allow our_sites
cache_peer_access myAccel allow our_sites
cache_peer_access myAccel deny all
# my next question will be: what's the best refresh_pattern line to
permanently cache pages containing my pattern:
refresh_pattern -i [?]q= 1000000 100 100 reload-into-ims
override-expire override-lastmod ignore-reload ignore-no-cache
Received on Tue Oct 18 2011 - 18:02:43 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 19 2011 - 12:00:06 MDT