You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ask Bjoern Hansen <as...@develooper.com> on 2002/08/27 13:37:07 UTC

mod_cache trouble

I am using the latest httpd from CVS.

I can't get mod_disk_cache to cache anything but 301's.

I suspect it's something related to the headers I (don't) send.

$ lwp-request -e -d -S http://nntp.x.perl.org/
GET http://nntp.x.perl.org/ --> 200 OK
Connection: close
Date: Tue, 27 Aug 2002 11:34:58 GMT
Via: 1.0 nntp.x.perl.org
Server: Apache/1.3.26 (Unix) mod_perl/1.27
Content-Length: 1896
Content-Type: text/html; charset=ISO-8859-1


My httpd.conf looks like the following,

LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so

[...]

<VirtualHost *>
  servername nntp.x.perl.org
  serveralias nntp.perl.org

  CacheOn on
  CacheRoot /home/web/front/cache/
  CacheSize 50000
  CacheDefaultExpire  43200
  CacheEnable disk /
  CacheDirLevels 5
  CacheDirLength 3

  RewriteEngine On
  RewriteCond  %{REQUEST_URI}    !^/js/
  RewriteCond  %{REQUEST_URI}    !^/proxy-status
  RewriteRule (.*) http://localhost:8222$1 [P]
</VirtualHost>

[...]

 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: mod_cache trouble

Posted by "Paul J. Reder" <re...@remulak.net>.
Will do.

Ask Bjoern Hansen wrote:

> On Tue, 27 Aug 2002, Paul J. Reder wrote:
> 
> 
>>Are you using the most recent head build of 2.0? There was a
>>fix applied recently to the header handling for mod_disk_cache.
>>
>>I am currently doing some work on the caching code, so I'll
>>look into this. Please let me know if you are on the latest
>>code.
>>
> 
> Yes, I am.  Let me know when you have something you'd like me to
> test.  :-)
> 
> 
>  - ask
> 
> 


-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein



Re: mod_cache trouble

Posted by "Paul J. Reder" <re...@remulak.net>.
I'll check on the time and date code to make sure it is all
clean.

Did you do a clean rebuild and maybe pickup some fixes that
the previous build had missed? I usually find that odd events
like this can be chalked up to having missed compiling a file...

I'm not suprised it works "mostly". mod_disk_cache needs some
work (as does mod_file_cache, though a little less so...). You
should start seeing fixes appearing soon. My goal is to get the
caching code out of experimental...

Ask Bjoern Hansen wrote:

> On Tue, 27 Aug 2002, Ask Bjoern Hansen wrote:
> 
> 
>>>Are you using the most recent head build of 2.0? There was a
>>>fix applied recently to the header handling for mod_disk_cache.
>>>
>>>I am currently doing some work on the caching code, so I'll
>>>look into this. Please let me know if you are on the latest
>>>code.
>>>
> 
> FWIW; it mostly works for me now.  I'm not entirely sure why it
> didn't before (and still doesn't for the nntp site in the previous
> example).  I figure I'm lacking some understanding of how mod_cache
> is dealing with the headers.  (Need to read through the code again).
> 
> Btw, the Age: header inserted by mod_cache seems to be in
> microseconds or something like that (instead of seconds).
> 
> 
>  - ask
> 
> 


-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein



Re: mod_cache trouble

Posted by Ask Bjoern Hansen <as...@develooper.com>.
On Tue, 27 Aug 2002, Ask Bjoern Hansen wrote:

> > Are you using the most recent head build of 2.0? There was a
> > fix applied recently to the header handling for mod_disk_cache.
> >
> > I am currently doing some work on the caching code, so I'll
> > look into this. Please let me know if you are on the latest
> > code.

FWIW; it mostly works for me now.  I'm not entirely sure why it
didn't before (and still doesn't for the nntp site in the previous
example).  I figure I'm lacking some understanding of how mod_cache
is dealing with the headers.  (Need to read through the code again).

Btw, the Age: header inserted by mod_cache seems to be in
microseconds or something like that (instead of seconds).


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: mod_cache trouble

Posted by Ask Bjoern Hansen <as...@develooper.com>.
On Tue, 27 Aug 2002, Paul J. Reder wrote:

> Are you using the most recent head build of 2.0? There was a
> fix applied recently to the header handling for mod_disk_cache.
>
> I am currently doing some work on the caching code, so I'll
> look into this. Please let me know if you are on the latest
> code.

Yes, I am.  Let me know when you have something you'd like me to
test.  :-)


 - ask

-- 
ask bjoern hansen, http://www.askbjoernhansen.com/ !try; do();


Re: mod_cache trouble

Posted by "Paul J. Reder" <re...@remulak.net>.
Are you using the most recent head build of 2.0? There was a
fix applied recently to the header handling for mod_disk_cache.

I am currently doing some work on the caching code, so I'll
look into this. Please let me know if you are on the latest
code.

Thanks,

Paul J. Reder

Ask Bjoern Hansen wrote:

> I am using the latest httpd from CVS.
> 
> I can't get mod_disk_cache to cache anything but 301's.
> 
> I suspect it's something related to the headers I (don't) send.
> 
> $ lwp-request -e -d -S http://nntp.x.perl.org/
> GET http://nntp.x.perl.org/ --> 200 OK
> Connection: close
> Date: Tue, 27 Aug 2002 11:34:58 GMT
> Via: 1.0 nntp.x.perl.org
> Server: Apache/1.3.26 (Unix) mod_perl/1.27
> Content-Length: 1896
> Content-Type: text/html; charset=ISO-8859-1
> 
> 
> My httpd.conf looks like the following,
> 
> LoadModule cache_module modules/mod_cache.so
> LoadModule disk_cache_module modules/mod_disk_cache.so
> 
> [...]
> 
> <VirtualHost *>
>   servername nntp.x.perl.org
>   serveralias nntp.perl.org
> 
>   CacheOn on
>   CacheRoot /home/web/front/cache/
>   CacheSize 50000
>   CacheDefaultExpire  43200
>   CacheEnable disk /
>   CacheDirLevels 5
>   CacheDirLength 3
> 
>   RewriteEngine On
>   RewriteCond  %{REQUEST_URI}    !^/js/
>   RewriteCond  %{REQUEST_URI}    !^/proxy-status
>   RewriteRule (.*) http://localhost:8222$1 [P]
> </VirtualHost>
> 
> [...]
> 
>  - ask
> 
> 


-- 
Paul J. Reder
-----------------------------------------------------------
"The strength of the Constitution lies entirely in the determination of each
citizen to defend it.  Only if every single citizen feels duty bound to do
his share in this defense are the constitutional rights secure."
-- Albert Einstein