cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <>
Subject Re: [ANN] runs on Cocoon!
Date Tue, 28 Sep 2004 05:54:12 GMT
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).


Also, the above seems to imply that you are writing your own generators? 
or are you using XSP or what?

> Also, we've been very careful to keep the whole thing stateless for 
> "public" visitors. There are a few drawbacks but it allows cached pages 
> to be shared between all visitors. Registering visitors and putting 
> their names on pages, for example, would make a big performance 
> difference in heavy traffic.

One approach that I recently thought to fix that is 'client-side 
templating': basically you render the page with a bunch of empty <div> 
or <span> tags with a specific ID, then you just link a javascript file 
that gets called with <body onload=""> which calls a method that 
sustributes all those tags with the right content, so the only 
user-specific part of your page is the javascript file that can be much 
faster to generate that the entire page (and can be completely stateful)

>> ...What pipeline flavor are you using? what XSLT transformer?
> Plain old caching pipelines, and saxon 8. I switched to saxon mostly 
> because of the better error messages that it generates, didn't do any 
> serious performance testing.


>> ...I would have liked 50/2 better, it would have allowed me to ask for 
>> 50 and maybe get a summary of the episode.
> hmm...this sounds fairly right - maybe we worked a bit too fast too 
> think sanely about everything ;-)


> Actually does return a summary, as in that case 
> there is a "50" document to keep the articles of that show together, but 
> I see your point.
>> ...having / instead of - wouldn't have increased your URL size ;-)
> Now you're turning the knife in the wounds ;-)
> So this will probably stay as big 
> deal.



View raw message