> If two browsers are downloading the same big file, such as a 600M linux.iso

> Say browser A started first, downloaded up to 50M, too big for polipo to 
> hold in memory cache, so a cache file was created.
> Then browser B starts,  the browser B's request will match A's half 
> downloading object. I am not quite understand the code as what the 
> polipo is going to process these two requests. 

> if the polipo privatize the object belong to request A and create a new 
> object for request B, how does B is going to named its cache file?

Could I please have a simpler question?

There's two cases to consider.  If the ISO is cacheable, which it
should be (if you're serving uncachable ISOs, you're doing something
wrong), then supersede will be false in httpServerHandlerHeaders, and
both requests will be served from the same in-memory cache entry; no
privatisation will happen.  In other words, the request will be sent
to the origin server just once, and will be used to satisfy both
clients' requests.

OTOH, if the ISO is not cacheable, then the reply to B's request will
supersede A's request (line 2126 in server.c).  This will cause A's
object to be privatised (line 2134), which in turn will call
destroyDiskEntry (line 681 in object.c).  When B creates a disk entry,
A's disk entry will be unlinked (line 1219 in diskcache.c).

In other words, A ends up not having a disk entry at all, the on-disk
cache entry belongs to B's object.

                                        Juliusz

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to