Re: [squid-users] Concurrency Handling

From: Henrik Nordstrom <[email protected]>
Date: Tue, 25 Nov 2003 22:03:34 +0100 (CET)

On Tue, 25 Nov 2003, Nimesh Shah wrote:

> How does Squid handle multiple request for same resource at the same
> time on its cache when it can not serve from cache?

Depends on timing and if the response is cachable or not. If the response
is cachable then requests arriving after Squid has received the response
headers (required to determine that the response is cachable) will join
the same request, getting the content from the already running request.

Requests arriving before this will initiate new requests for the object.

> If it does update (the cache) every such response (which will be same)
> from origin server, how does it handle this (or to put it other way,
> is there locking or lock management in Squid)?

There is atomic replaces of the object cached on a URL, and the objects as
such are reference counted. If a cached object gets replaced by a newer
copy then the old object stays around as long as there is active
references to it, but any new requests will only see the new object.

Regards
Henrik
Received on Tue Nov 25 2003 - 14:04:40 MST

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