Apache 2.2 cache proxy

Apache 2.2 cache proxy

am 22.09.2007 10:45:57 von asrenzo

Hello,

I need to know if apache 2.2 is able to cache any content that would be
returned from an upstream server (aka Zope in this case). I know how to
do that with a squid server but I have to find a solution with apache
only. I need to configure apache to force a cache of any content without
Zope rendrering cache control headers.

Here's what I started but I can't see any file in my cache directory and
total number of request per second is stable, so I think my
configuration is false but I can not find where.

LoadModule cache_module modules/mod_cache.so
LoadModule disk_cache_module modules/mod_disk_cache.so
LoadModule file_cache_module modules/mod_file_cache.so
LoadModule mem_cache_module modules/mod_mem_cache.so

ProxyRequests On


Order deny,allow
Deny from all
Allow from all # For test only


ProxyVia On

CacheEnable disk /
CacheRoot "/var/cache/mod_proxy"
CacheDirLevels 5
CacheDirLength 3
CacheDefaultExpire 60


ServerName www.monsite.com
DocumentRoot /home/zope/data/www

RewriteEngine on

RewriteCond %{REQUEST_URI} !^/files(.*)
RewriteCond %{REQUEST_URI} !^/common(.*)
RewriteCond %{REQUEST_URI} !^/design(.*)
RewriteCond %{REQUEST_URI} !^/robots.txt
RewriteRule ^/(.*)
http://127.0.0.1:8080/VirtualHostBase/http/%{HTTP_HOST}:%{SE RVER_PORT}/Examples/VirtualHostRoot/$1
[L,P]


Any idea ?

Regards,

Laurent

Re: Apache 2.2 cache proxy

am 22.09.2007 16:35:51 von asrenzo

For anybody trying to fix this problem, here is the solution:

Add this directive to your configuration:

CacheIgnoreNoLastMod On

Regards,

Laurent

asrenzo a écrit :
> Hello,
>
> I need to know if apache 2.2 is able to cache any content that would be
> returned from an upstream server (aka Zope in this case). I know how to
> do that with a squid server but I have to find a solution with apache
> only. I need to configure apache to force a cache of any content without
> Zope rendrering cache control headers.
>
> Here's what I started but I can't see any file in my cache directory and
> total number of request per second is stable, so I think my
> configuration is false but I can not find where.
>
> LoadModule cache_module modules/mod_cache.so
> LoadModule disk_cache_module modules/mod_disk_cache.so
> LoadModule file_cache_module modules/mod_file_cache.so
> LoadModule mem_cache_module modules/mod_mem_cache.so
>
> ProxyRequests On
>
>
> Order deny,allow
> Deny from all
> Allow from all # For test only
>

>
> ProxyVia On
>
> CacheEnable disk /
> CacheRoot "/var/cache/mod_proxy"
> CacheDirLevels 5
> CacheDirLength 3
> CacheDefaultExpire 60
>
>
> ServerName www.monsite.com
> DocumentRoot /home/zope/data/www
>
> RewriteEngine on
>
> RewriteCond %{REQUEST_URI} !^/files(.*)
> RewriteCond %{REQUEST_URI} !^/common(.*)
> RewriteCond %{REQUEST_URI} !^/design(.*)
> RewriteCond %{REQUEST_URI} !^/robots.txt
> RewriteRule ^/(.*)
> http://127.0.0.1:8080/VirtualHostBase/http/%{HTTP_HOST}:%{SE RVER_PORT}/Examples/VirtualHostRoot/$1
> [L,P]
>

>
> Any idea ?
>
> Regards,
>
> Laurent