Hi Harry,

I did set mod_expires to set an expiry date of "access plus 1 week" -
and when I GET the urls from the site I see the correct "Expires: "
value in the header-
Yet mod_disk_cache won't cache any dynamic content (perl scripts, tomcat
jsp's, etc).
It does cache all the static content that apache fetches from the disk,
though.

Any idea why would that happen? 

Thanks,
Ori.



-----Original Message-----
From: harald deppeler [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 19, 2003 6:32 PM
To: Ori Tend
Cc: [EMAIL PROTECTED]
Subject: Re: mod_disk_cache problem


Hi Ori

On Wed, Mar 19, 2003 at 04:14:45PM +0200, Ori Tend wrote:
> Hi again Harry,
> 
> Just wanted to let you know you've helped me :-)
> It really was the case- I chown-ed the cache directory to user nobody,

> and apached started to fill it with some files... I assumed that it 
> should be the same owner as the owner of the other apache log files.. 
> I assumed wrong :-)

Glad this helped. I remember bumping into this as well ...

> 
> I have another question, though- it looks like apache doesn't cache 
> the dynamic info that tomcat generates (tomcat is connected via 
> mod_jk). Any idea why? I also tried to enable mod_proxy, but it didn't

> help- tomcat still receives the same requests again and again, even 
> though apache is supposed to cache it...

The way I understand it:
mod_cache caches according to the HTTP RFC, which means that the
back-end ought to provide appropriate headers that help the cache
determine how long it should cache the data. If the backend does not
provide any such headers (expire, last-modified), the cache doesn't
cache, especially if the URL contains a query string.

At work I recently ran into a similar problem. (Pseudo-) dynamic
back-end content with no such cache-friendly headers *had* to be cached
(or our site would performance crash) and we modified a 2.0.44 vanilla
Apache to serve our needs. Since most changes are a rather quick hack
and since they violate the RFC, I did not dare to propose them to the
list but feel free to use them (they should be attached to this mail).
You would patch like

#!/bin/sh -ex
DIRECTORY=httpd-2.0.44
files_to_patch="mod_cache.c mod_disk_cache.c"
path_to_files="${DIRECTORY}/modules/experimental"
for file in $files_to_patch
do
        patch ${path_to_files}/$file < ${file}.diff
done
exit 0

before doing the make to compile.

The patch also enables that URLs ending with a / are cached.

Cheers - Harry

> 
> Thanks,
> Ori.
> 
> -----Original Message-----
> From: Ori Tend [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 16, 2003 8:03 PM
> To: 'harald deppeler'
> Subject: RE: mod_disk_cache problem
> 
> 
> Hi Harry,
> 
> First off, thanks for your reply :-)
> /usr/local/apache2/proxy owned by root- and I run apache always as 
> root (also, all of apache's other directories are owned by root, so I 
> assume this is ok for apache).
> 
> I tried to play with the CacheDefaultExpire, hoping that is the reason

> why apache didn't write anything to the CacheRoot directory, but it 
> didn't help- apache doesn't write anything to that directory...
> 
> I kind of suspect it has to do with a compilation option I didn't set 
> or so... But I really don't know which...
> 
> Ori.
> 
> 
> -----Original Message-----
> From: harald deppeler [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 16, 2003 7:10 PM
> To: Ori Tend
> Subject: Re: mod_disk_cache problem
> 
> 
> On Sun, Mar 16, 2003 at 04:03:35PM +0200, Ori Tend wrote:
> >  
> > I'm using apache standard cache configuration (loading
> > mod_disk_cache). Yet for some reason, apache doesn't write anything
to
> 
> > the CacheRoot dir. Just to make sure I didn't do anything wrong, I 
> > reinstalled apache
> > again- this time on Win32, and using
> > the exact same cache configuration apache cached all the urls, as it

> > should have.
> >  
> > Just to make sure it doesn't have to do with mod_jk2 and tomcat
> > connectivity, I tried to see if apache caches static content (html 
> > files which are not served by tomcat) - and apache didn't cache
those 
> > as well.
> >  
> > any help would be greatly appreciated...
> >  
> >  
> > my httpd.conf (all is default, commented in the following):
> >  
> > LoadModule cache_module modules/mod_cache.so
> > LoadModule disk_cache_module modules/mod_disk_cache.so
> >  
> > CacheRoot "/usr/local/apache2/proxy"
> > CacheSize 5
> > CacheGcInterval 4
> > CacheMaxExpire 24
> > CacheLastModifiedFactor 0.1
> > CacheDefaultExpire 1
> > CacheEnable disk /
> 
> Is "/usr/local/apache2/proxy" writable by the httpd UID?
> 
> Does your backend service generate HTTP headers that set the caching 
> expiry time? If not, your default expiry time would be 1 second. Is 
> that really what you want?
> 
> If any of this helps, please post the solution to the list.
> 
> Cheers - Harry
> 
> 
> 

Reply via email to