Mailing List Archive

Caching configuration
OK, I'm stumped.

Environment: Solaris (sparc) 2.6
apache 1.3.11
modperl 1.21
perl 5.00503

I've got a heavy modperl server, dynamically generating date bar
images (http://date.boston.com/). I'm setting up a high speed, low
drag proxying server in front of this to free the heavy server from
the burden of sending data to clients at the end of slow dialup
connections, as recommended in Stas' guide.

The proxying part works fine, but in trying to get the proxy server to
cache the generated images, I can't seem to get it to work correctly.
Running 'ab' to put a load on the server, I see requests to the proxy,
and its (the proxy's) requests to the backend server for every
request.

(For testing, I currently have the proxying server running on port
8080 -- http://date2.boston.com:8080/, and the modperl server on port
80.)

Here are some pertinent lines from my config:
ProxyRequests on

ProxyPass / http://date2.boston.com:80/

CacheRoot "/apache/proxy2/cache"
CacheSize 100
CacheGcInterval 4
CacheMaxExpire 24
CacheLastModifiedFactor 0.1
CacheDefaultExpire 1

Yes, the cache directory is owned by the user/group that the web
server is running as.

Yes, my date generation module is supplying an 'Expires' header to the
returned image.

The only thing in the cache directory is a '.time' file, with a
modification time that reflects that of the last server request.

Anyone have any ideas what could be causing the caching not to work?

Thanks.
<Steve>

-=-=-=-=-=-=-=-=-=- My God! What have I done? =-=-=-=-=-=-=-=-=-=
Steve Reppucci 617/929-7003
Director of Software Development reppucci@boston.com
Boston.com (Times Company Digital) Be Open
Re: Caching configuration [ In reply to ]
Hello Steve,

ñðåäà, 23 ôåâðàëÿ 2000 ã., you wrote:


SR> ProxyRequests on

SR> ProxyPass / http://date2.boston.com:80/

SR> CacheRoot "/apache/proxy2/cache"
SR> CacheSize 100
SR> CacheGcInterval 4
SR> CacheMaxExpire 24
SR> CacheLastModifiedFactor 0.1
SR> CacheDefaultExpire 1

If this is version of apache prior to 1.3.11, you should declare all
mod_proxy directives in VitualHost context, otherwise it doesn't work
at all ;) I heard that this is fixed in 1.3.11, but I'm not certain
about it.

SR> Yes, my date generation module is supplying an 'Expires' header to the
SR> returned image.

Does it also supply "Content-Length" and "Last-Modified"? It really
should, otherwise mod_proxy won't cache the data.

SR> The only thing in the cache directory is a '.time' file, with a
SR> modification time that reflects that of the last server request.

SR> Anyone have any ideas what could be causing the caching not to work?

Seems like this is a first case.

Best regards,
Ilya mailto:ilya@zhurnal.ru
Re: Caching configuration [ In reply to ]
Thanks Ilya,

The directives *are* in a virtual host section.

I'm certain that the content length directive is being sent, but
possibly not a "Last-Modified" header, I'll check on this.

Thanks for the suggestions!
<Steve>

On Wed, 23 Feb 2000, Ilya Obshadko wrote:

> Hello Steve,
>
> ñðåäà, 23 ôåâðàëÿ 2000 ã., you wrote:
>
>
> SR> ProxyRequests on
>
> SR> ProxyPass / http://date2.boston.com:80/
>
> SR> CacheRoot "/apache/proxy2/cache"
> SR> CacheSize 100
> SR> CacheGcInterval 4
> SR> CacheMaxExpire 24
> SR> CacheLastModifiedFactor 0.1
> SR> CacheDefaultExpire 1
>
> If this is version of apache prior to 1.3.11, you should declare all
> mod_proxy directives in VitualHost context, otherwise it doesn't work
> at all ;) I heard that this is fixed in 1.3.11, but I'm not certain
> about it.
>
> SR> Yes, my date generation module is supplying an 'Expires' header to the
> SR> returned image.
>
> Does it also supply "Content-Length" and "Last-Modified"? It really
> should, otherwise mod_proxy won't cache the data.
>
> SR> The only thing in the cache directory is a '.time' file, with a
> SR> modification time that reflects that of the last server request.
>
> SR> Anyone have any ideas what could be causing the caching not to work?
>
> Seems like this is a first case.
>
> Best regards,
> Ilya mailto:ilya@zhurnal.ru
>
>

-=-=-=-=-=-=-=-=-=- My God! What have I done? =-=-=-=-=-=-=-=-=-=
Steve Reppucci 617/929-7003
Director of Software Development reppucci@boston.com
Boston.com (Times Company Digital) Be Open
Re: Caching configuration [ In reply to ]
OK, Ilya's suggestion of adding a 'Last-Modified' header was apparently
the key piece I was missing, adding this made the caching stuff work as
expected.

Interesting to note however, that file-based caching actually resulted in
a slower response -- my date module caches generated images in memory, so
having the proxy server simply draw from the cached copy served by the
modperl server seems to offer the best performance. The proxying piece is
a definite win though -- server load appears down significantly in
somewhat limited tests thus far.

Thanks for the help.
<Steve>


On Wed, 23 Feb 2000, Ilya Obshadko wrote:

> Hello Steve,
>
> ñðåäà, 23 ôåâðàëÿ 2000 ã., you wrote:
>
>
> SR> ProxyRequests on
>
> SR> ProxyPass / http://date2.boston.com:80/
>
> SR> CacheRoot "/apache/proxy2/cache"
> SR> CacheSize 100
> SR> CacheGcInterval 4
> SR> CacheMaxExpire 24
> SR> CacheLastModifiedFactor 0.1
> SR> CacheDefaultExpire 1
>
> If this is version of apache prior to 1.3.11, you should declare all
> mod_proxy directives in VitualHost context, otherwise it doesn't work
> at all ;) I heard that this is fixed in 1.3.11, but I'm not certain
> about it.
>
> SR> Yes, my date generation module is supplying an 'Expires' header to the
> SR> returned image.
>
> Does it also supply "Content-Length" and "Last-Modified"? It really
> should, otherwise mod_proxy won't cache the data.
>
> SR> The only thing in the cache directory is a '.time' file, with a
> SR> modification time that reflects that of the last server request.
>
> SR> Anyone have any ideas what could be causing the caching not to work?
>
> Seems like this is a first case.
>
> Best regards,
> Ilya mailto:ilya@zhurnal.ru
>
>

=-=-=-=-=-=-=-=-=-=- My God! What have I done? -=-=-=-=-=-=-=-=-=-=
Steve Reppucci sgr@logsoft.com |
Logical Choice Software http://logsoft.com/ |
508/958-0183 Be Open |