On 12/9/06, allan juul <allan@xxxxxxx> wrote:
hi Joshua, thanks for the quick reply Joshua Slive wrote: > On 12/9/06, allan juul <allan@xxxxxxx> wrote: >> 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. in other words, if no AGE is set, i can assume our disk cache is ignored ? but why does it fill the cache then if it's not going to use it ?
It puts the stuff in the cache if there is some chance it can be used (even if that chance only lasts for 2 seconds). Whether it is actually used or not depends on the conditions of subsequent requests.
> 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).
i see what you mean, hmm, what would be normal Expires difference be (an hour or so)?
That depends entirely on your content. You should set Expires and Cache-Control based on your freshness requirements.
Is it actually possible to ignore it completely, something like? CacheIgnoreHeaders Expires CacheDefaultExpire 86400
I don't know if that will work. CacheIgnoreHeaders if for controlling storage of hop-by-hop headers, not for monkeying with freshness. You'd also need at least CacheIgnoreNoLastMod in your case. But you are better off simply sending reasonable Cache-Control and expires headers from your back-end. That will make your cache work, and will also help other caches along the way. If you really can't do that (because you want the apache cache using different settings than the foreign caches), just don't send the expires at all from the back-end, use CacheIgnoreNoLastMod, CacheDefaultExpire, and then use mod_expires to set a new Expires/Cache-Control at the proxy. Joshua. --------------------------------------------------------------------- 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