need some help in serving static files inside a wsgi apps

"Martin v. Löwis" martin at v.loewis.de
Sun May 25 11:01:33 EDT 2008


>>> I guess, Apache does some kind of memory caching for files, which are often
>>> requested and small enough to fit into the system memory.  May be, that's
>>> what the OP is referring to ...
> 
>> I'm not aware of that, and I even more seriously doubt it. Because 
>> caching is a complicated, domain-dependend subject that would 
>> *immediately* cry for configuration - e.g. caching strategies and such.
> 
> This is available in current apache with mod_file_cache (for an
> explicitly configured list of files). I think the circumstances where
> you'd want to use it are quite rare.

Interestingly enough, this *doesn't* do memory caching for files.
Instead, it either keeps the file handle open, so you can seek to the
beginning of the file on the next request (avoiding the directory
lookup), or you can mmap the file. However, even if you mmap the file,
it is still the operating system's choice whether or not to cache the
file contents in memory.

Regards,
Martin



More information about the Python-list mailing list