Hi all, On Wed, Apr 16, 2008 at 9:21 PM, Narendra Verma <[EMAIL PROTECTED]> wrote: > Hi Howard, > 1. Be sure to load following module > > LoadModule headers_module modules/mod_headers.so > > 2. Add following Header directive at the last of httpd.conf file. > > Header add Cache-Control max-age=3600 (in seconds) > > Here we can decide that what is the maximum age of cached response. > If max-age passed then apache again sends request to backend(tomcat) for > re-caching, if the body of response is not found modified then 304 status is > found means existing cache would be used.If body changed then then it is > re-cached. You can use any amount of time to decide re-caching. >
The problem is I don't know to cache for how long. Maybe 1 month, or maybe one second, consider a blog post, it will be only updated when a user leave a comment, but the exact time is unpredictable. Currently I am using PHP / Smarty cache, if a user leave a comment, I will remove cache from the file system and the cache will be re-generated next time if cache miss. The only draw back is since for a cached case, I am sending HTML via PHP, so why I don't send the cache via Apache? The lighttpd Cache Meta Language (http://en.wikipedia.org/wiki/Cache_Meta_Language) is what exactly doing what I want, but I am just wondering if Apache users have think of this before? ) On the other hand, mod_cache seems can't do what I want. Squid did (wikipedia is using similar approach with "purge' multicast). Of coz setting a squid is another overhead for my simple use. Howard --------------------------------------------------------------------- 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: [EMAIL PROTECTED] " from the digest: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]