Re: determine cache or no cache of dynamic content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/9/06, allan juul <allan@xxxxxxx> wrote:
hello,


[win2003 / apache 2.2]

using mod_disk_cache and mod_rewrite we are trying to cache responses
with rarely updated but dynamic content served from a heavy loaded backend.

how can one determine if a certain request is actually served from the
cache and not the backend from where it originally came from ?

Check the Age HTTP response header.  If the proxy sends this header
with a non-zero value, it is using the cache.

Note that the response headers from your backend don't seem to give
much lee-way for caching with only 2 seconds difference between the
date and expires header and you have no HTTP/1.1 caching stuff
(cache-control).

Joshua.



we can see our disk cache is growing, but assuming we (via script for
example) just hit the same URL over and over again, would it not then be
possible to turn off the backend server completely and our frontend
would still work happily serving from the disk cache? (that test would
work if it was a static file like a gif image it seems)

below are relevant parts from configuration and response headers

thanks
./allan

conf
----
RewriteEngine On
RewriteRule ^/(.*) http://remote.backend.com:12345/$1    [proxy,last]

CacheEnable disk /
CacheDefaultExpire 3600
CacheRoot d:/cacherootlocalhost
CacheDirLevels 5
CacheDirLength 3



response headers from backend (http statuscode = 200)
-----------------------------
Connection: close
Date: Sat, 09 Dec 2006 21:13:53 GMT
Allow: GET
Content-Length: 756
Content-Type: text/xml; charset=UTF-8
Expires: Sat, 09 Dec 2006 21:13:55 GMT
Client-Date: Sat, 09 Dec 2006 21:13:53 GMT
Client-Peer: 127.0.0.1:80
Client-Response-Num: 1



---------------------------------------------------------------------
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-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



---------------------------------------------------------------------
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-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux