cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: [ANN] www.nouvo.ch runs on Cocoon!
Date Tue, 19 Oct 2004 19:18:43 GMT
On Tue, 28 Sep 2004, Bertrand Delacretaz wrote:

> Le 28 sept. 04, à 04:12, Stefano Mazzocchi a écrit :
>
>> Bertrand Delacretaz wrote:
>>> ...The performance part comes mainly from the front-end apache2 
>>> mod_cache. Simply adding the right HTTP headers and making sure the 
>>> content-length header is generated as well (by setting the buffering 
>>> flag on the HTML serializer) allows the front -end cache to do its job 
>>> very nicely.
>> 
>> uh, I might have missed that part!!! would be cool if you could document 
>> that.
>
> I'll describe this on the wiki, but basically it's only a case of adding the 
> "Last-Modified"; "Expires" and "Cache-Control" headers to the response:
>
> final long lastModTime = document.lastModified().getTime();
> final long expires = System.currentTimeMillis() + 
> (cacheForHowMaySeconds * 1000L);
>
> resp.addDateHeader(LAST_MOD_HEADER,lastModTime);
> resp.addDateHeader(EXPIRES_HEADER,expires);
> resp.addHeader(CACHE_CONTROL_HEADER,"max-age="+ 
> cacheForHowMaySeconds);
>
> And creating an HtmlSerializer where shouldSetContentLength() returns true 
> (we should make this configurable BTW).

Wouldn't mod_header and mod_cache be able to do that for you?

Giacomo

-- 
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message