On Tue, 26 Sep 2006, Graham Leggett wrote:

Niklas Edmundsson wrote:

* Realising that a file is a file and can be copied as such, without
  reading the whole thing into memory first.
* When a file is cached by copying, replace the brigade with a new one
  refering to the cached file so we don't have to read the file from
  the backend again when sending a response to the client.

As I read the code, the copy is completed before an attempt is made to deliver the copy to the network. This should in theory stop a slow initial client from holding up faster following clients, if the caching is still "in transit".

Is this correct?

This is the original design of mod_disk_cache (which isn't changed by this patch), so yes.

In practice this isn't enough when dealing with large files, so in our production code (the hideously large jumbopatch) this is fixed by read-while-caching and spawning a thread to do the caching in the background while delivering the response (by read-while-caching) to the client that initiated the caching.

/Nikke
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     [EMAIL PROTECTED]
---------------------------------------------------------------------------
 "Why don't you go teach someone who actually needs to learn?!" - Buffy
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Reply via email to