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

Reply via email to