httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Lewis <...@joe-lewis.com>
Subject Re: Questions on modules to provide cache functions for Apache
Date Tue, 06 Mar 2007 20:04:58 GMT
Erica Zhang wrote:
> No, still not work. Infact, mod_cache could work, because it could 
> cache the javascript. But it could not work for dynamic HTTP responses 
> responding to XMLHttpRequests in Ajax technology. So I suspect 
> mod_cache could not support this function. And I need provide such 
> function by myself. I prefer to do it in Apache, a comparatively 
> general way instead of application itself.

The reason it does not cache the dynamic responses is because those 
headers (Expires, Cache-Control and Last-Modifed) do NOT exist with that 
content. In that situation again, you have two options :

a) modify the generator (the java class generating the XML data) to 
supply a last-modifed header.
b) blind cache it - again causing discrepancies in data at the browser 
and data supplied by the server.

It is always suggested that, if the data is to be cached, the generator 
needs to submit the appropriate caching headers. If the headers are not 
submitted by the generator and something does cache it without checking 
for updates at the server, don't expect "up-to-date" hits on this 
dynamic data from a browsers' perspective - it simply cannot happen.

Joe
-- 
Joseph Lewis <http://sharktooth.org/>
"Divide the fire, and you will sooner put it out." - Publius Syrus

Mime
View raw message