httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Leggett <minf...@sharp.fm>
Subject Re: mod_proxy and buff.c
Date Wed, 15 Mar 2000 10:13:49 GMT
Chuck Murcko wrote:

> Separately caching header and body seems most flexible to me, and
> doesn't require a new function in buff.c, but does raise perf concerns
> under heavy loads. There is the possibility of writing
> ap_bgets_with_header() or something for this purpose, that would read
> the header and body to separate buffers, and save the extra read.

An extra file means at least one extra cluster wasted on the drive per
cached file, which on big caches would amount to a lot of space.

> Read() and write() should be avoided here. I've gotten in trouble about
> this before. 8^)

Ok...

How about this:

The headers are stored before the body. What if we created a "buffer
zone" between the end of the headers and the start of the body made of
whitespace (a long blank line for example).

When the headers are updated, they will be combined with the existing
headers and rewritten at the start of the file. The buffer space will
ensure that it the headers got slightly longer, there would still be
space for them. Because in almost all cases "new updated headers" are
just replaced Expires headers, the buffer need not be very big at all.

Like this:

cache header CRLF
X-URL: <>CRLF
HeadersCRLF
CRLF
long buffer line space space space CRLF
body
EOF

Regards,
Graham
--

Mime
View raw message