httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Edmundsson <>
Subject Re: My hacked mod_xsendfile
Date Sun, 27 Jan 2008 14:05:21 GMT
On Sun, 27 Jan 2008, Colm MacCarthaigh wrote:

> On Sun, Jan 27, 2008 at 10:46:12AM +0100, Niklas Edmundsson wrote:
>> Using subrequests means that mod_cache won't bite, right? At least
>> that's the reason for mod_ftp-requests not being handled by the cache
>> from what I've understood.
> This seems like a good thing to me; the file must be local anyway, or we
> wouldn't be able to use sendfile to begin with, so it's not going to
> benefit from caching (even mod_mem_cache really, since all of the OS's
> with sendfile cache the file in ram anyway).

It can be sendfile:able without being local using network filesystems 
and in those cases you'll want the caching. The cache config should 
reflect your choice, not assumptions on whether or not a files 
sendfile:ability implies caching or not.

In fact, given a VFS layer in httpd we might end up with some magic 
provider for the filename that you want to cache.

> And since the point of X-Sendfile is to allow for /dynamic/ choice of
> file to send, caching would be inappropriate. I guess the marginal
> case might be when mod_cache would do a better of job of negotiating
> the Vary: semantics than any backend cgi/whatever might.

Regarding whether the request is cache:able or not this should already 
be solved by setting the appropriate headers, right?

Thinking a bit, it makes more sense if mod_cache is able to cache 
subrequests (as Ruediger claims), because it would handle the scenario 
of a script wanting to send a backend file (from slow nfs for example) 
and you want to cache the file on local storage but you can't cache 
the entire request.

It might not be the most common scenario, but my point is that it's 
better thinking about handling all weird cases to begin with than 
making assumptions that might bite someone someday...

  Niklas Edmundsson, Admin @ {acc,hpc2n}      |
  A little greed can get you a lot of stuff.

View raw message