Hi
I have one proxy with mod_cache and mod_disk_cache. Apache is 2.2.11
compiled from source.
The backends are apache 1.3 also compiled from source.
On the proxy server the cache related config are :
<IfModule cache_module>
CacheDefaultExpire 3600
CacheMaxExpire 43200
CacheIgnoreCacheControl Off
CacheIgnoreHeaders Set-Cookie
CacheIgnoreNoLastMod On
CacheIgnoreQueryString Off
CacheStoreNoStore Off
CacheStorePrivate Off
<IfModule disk_cache_module>
CacheEnable disk /
CacheRoot /var/cache/mod_proxy
CacheDirLevels 2
CacheDirLength 1
CacheMaxFileSize 104857600
CacheMinFileSize 100
</IfModule>
</IfModule>
The backends have mod_expires active base on file type and also add
append to Cache-Control headers proxy-revalidate, s-maxage=60 so the
headers look like this
Cache-Control: max-age=2592000, proxy-revalidate, s-maxage=60
for a css file
Now , in cache_util.c said :
* - RFC2616 14.9.3 Cache-Control: max-stale, must-revalidate,
* proxy-revalidate if the max-stale request header exists, modify the
* stale calculations below so that an object can be at most
<max-stale>
* seconds stale before we request a revalidation, _UNLESS_ a
* must-revalidate or proxy-revalidate cached response header exists to
* stop us doing this.
*
* - RFC2616 14.9.3 Cache-Control: s-maxage the origin server
specifies the
* maximum age an object can be before it is considered stale. This
* directive has the effect of proxy|must revalidate, which in turn
means
* simple ignore any max-stale setting.
The expected behavior is:
- make a request->proxy ask for the file on the backend-> receive the
file with Cache-Control headers that I mentioned early->store the file
on disk.
- after 60 seconds or more, make the same request , the proxy must
consider the file stale and check on the backend to see if something is
change (because of proxy-revalidate, s-maxage=60) . The respons will be
304 or 200 (if the file have been modified)
What happening in fact is that the proxy never check the backend to
verify the state of a file.
If I make few wget requests like :
# wget -S 'http://domain.tld/file.css' -O /dev/null
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Mon, 08 Jun 2009 09:04:22 GMT
Server: Apache
Last-Modified: Sun, 10 May 2009 11:24:41 GMT
ETag: "8f9-4698d1b969040"-gzip
Accept-Ranges: bytes
Cache-Control: max-age=2592000, proxy-revalidate, s-maxage=60
Expires: Wed, 08 Jul 2009 08:38:38 GMT
Content-Encoding: gzip
Age: 1544
Content-Length: 841
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/css
Length: 841 [text/css]
The next request :
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Mon, 08 Jun 2009 09:12:01 GMT
Server: Apache
Last-Modified: Sun, 10 May 2009 11:24:41 GMT
ETag: "8f9-4698d1b969040"-gzip
Accept-Ranges: bytes
Cache-Control: max-age=2592000, proxy-revalidate, s-maxage=60
Expires: Wed, 08 Jul 2009 08:38:38 GMT
Content-Encoding: gzip
Age: 2003
Content-Length: 841
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/css
Length: 841 [text/css]
And so on. The Age keep growing, and on the backends never see any
requests (always is serve from proxy cache).
If I force proxy revalidation , sending header "Cache-Control: no-store,
no-cache" to wget , I can see on backend a request and a 200 response ,
but after that all works like I describe.
With this situation, proxy may always serve a stale content.
This behavior I've see it no mater of version protocol (1.1 or 1.0)
between proxy and backend.
It's something wrong with my configs?
Have anyone experience this behavior with mod_proxy and mod_cache ?
alex
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
" from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org