[squid-users] Invalidating IPcache entry with positive TTL on Pragma: no-cache

From: Rob Marchand <[email protected]>
Date: Fri, 16 May 2003 02:20:46 +0000

Hi Folks,

A question.

In squid 2.5 stable1 (configured with external DNS, but don't know that it
matters), a reload seems to force an IP cache entry with a positive TTL to
be invalidated, and thus the DNS lookup is redone.

I see that a patch was posted to do IP address invalidation for an entry
with a negative TTL in this situation (against 2.3stable5?).

However, the invalidation from client_side.c was done with
ipcacheReleaseInvalid in the original patch.
This function checked the name, and ensured that the entry was negatively
cached, and then invalidated the entry.

Squid 2.5 calls ipcacheInvalidate in this case though - this function makes
sure the name is okay, and then invalidates it (regardless of the status of
the cache entry). The comment in client_side.c (from the original patch I
think) is "Release negatively cached IP-cache entries on reload", which was
correct when calling ipcacheReleaseInvalid, but seems not quite right now.

The net result is that on any reload, the DNS lookup recurs.

Is this the intended behaviour? If so, sorry for pestering you, but if not,
I guess that
(in ipcache.c)

void
ipcacheInvalidate(const char *name)
{
ipcache_entry *i;
if ((i = ipcache_get(name)) == NULL)
return;
if (i->flags.negcached)
/\* only invalidate entry that is negatively cached \*/
i->expires = squid_curtime;

}

would do the trick? Not sure though - maybe this would break something
else.
Henrik had posted some discussion whether invalidating the cached lookup was
the
right thing to do given that DNS servers are usually overloaded, and the
number
of reloads that are done.

Thanks, by the way, for a great product.

Cheers,
Rob

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail
Received on Thu May 15 2003 - 20:21:21 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:16:41 MST