You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Wi...@ldc.be on 2006/01/12 15:01:36 UTC

[users@httpd] Apache reverse and caching proxy

Hello all,

I'm retrying my configuration for a caching proxy server which flushes the 
cache on the modification time of the files. However, It doesn't seem to 
work anymore. The files get cached but are not refreshed on a touch of the 
file on the source server. 

Not sure what I changed that it doesn't work anymore. As far as I'm 
concerned, I do nothing more then setup an apache server to serve static 
files from disk in an ordinary manner. Next I put a proxy server in front. 
The configuration of the proxy can be found at the end.

When inspecting the debug logs and the http headers, all files get cached 
at the proxy. However when I change the modification time of the files on 
the source servers, the cache doesn't get updated. Thus still serving the 
old version of the file. 

As a matter a fact, once a file is cached, the source server is never 
accessed anymore to verify the correctness of the cache against the remote 
instances. 

Does anybody have a clue about which sublety I'm missing here?

Thanks beforehand!
Wim Van Leuven

________________________________

...
ExpiresActive On
ExpiresDefault "modification"
...
ProxyRequests Off

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

ProxyPass / http://srcsvr.ldc.local/
ProxyPassReverse / http://srcsvr.ldc.local/

# Cache configuration
<IfModule mod_cache.c>
    LoadModule disk_cache_module modules/mod_disk_cache.so
    <IfModule mod_disk_cache.c>
        CacheRoot "C:/Program Files/Apache Group/Apache2/cache"
        CacheSize 256
        CacheEnable disk /
        CacheDirLevels 5
        CacheDirLength 3
        CacheIgnoreCacheControl Off
    </IfModule>
 
    #LoadModule mem_cache_module modules/mod_mem_cache.so
    <IfModule mod_mem_cache.c>
        CacheEnable mem /
        MCacheSize 4096
        MCacheMaxObjectCount 100
        MCacheMinObjectSize 1
        MCacheMaxObjectSize 2048
    </IfModule> 
</IfModule>

Re: [users@httpd] Apache reverse and caching proxy

Posted by Joshua Slive <jo...@slive.ca>.
On 1/12/06, Wim.Van.Leuven@ldc.be <Wi...@ldc.be> wrote:
>
> Hello Joshua,
>
> I can follow what you are saying. Can I force this header inclusion for static file serving?

Header add Cache-Control must-revalidate
on the origin server.

Joshua.

Re: [users@httpd] Apache reverse and caching proxy

Posted by Wi...@ldc.be.
Hello Joshua,

I can follow what you are saying. Can I force this header inclusion for 
static file serving?





Joshua Slive <jo...@slive.ca> 
Sent by: jslive@gmail.com
12/01/2006 15:11
Please respond to
users@httpd.apache.org


To
users@httpd.apache.org
cc

Subject
Re: [users@httpd] Apache reverse and caching proxy






On 1/12/06, Wim.Van.Leuven@ldc.be <Wi...@ldc.be> wrote:
> When inspecting the debug logs and the http headers, all files get 
cached at
> the proxy. However when I change the modification time of the files on 
the
> source servers, the cache doesn't get updated. Thus still serving the 
old
> version of the file.
>
> As a matter a fact, once a file is cached, the source server is never
> accessed anymore to verify the correctness of the cache against the 
remote
> instances.
>
> Does anybody have a clue about which sublety I'm missing here?

The cache uses standard http caching rules, which require period
checks for content updates based either on Cache-Control, Expires, or
Last-Modified headers.  If you want the cache to check for new content
on every request, you need to make the back-end send "Cache-Control:
must-revalidate" or something like that.

Joshua.


Re: [users@httpd] Apache reverse and caching proxy

Posted by Joshua Slive <jo...@slive.ca>.
On 1/12/06, Wim.Van.Leuven@ldc.be <Wi...@ldc.be> wrote:
> When inspecting the debug logs and the http headers, all files get cached at
> the proxy. However when I change the modification time of the files on the
> source servers, the cache doesn't get updated. Thus still serving the old
> version of the file.
>
> As a matter a fact, once a file is cached, the source server is never
> accessed anymore to verify the correctness of the cache against the remote
> instances.
>
> Does anybody have a clue about which sublety I'm missing here?

The cache uses standard http caching rules, which require period
checks for content updates based either on Cache-Control, Expires, or
Last-Modified headers.  If you want the cache to check for new content
on every request, you need to make the back-end send "Cache-Control:
must-revalidate" or something like that.

Joshua.