ok, tried a couple of things, but none of them work: 1. in the container component keep track of the element that is created by the container component. in the afterRender fetch the html as element.toString() and put to cache.
in the beginrender method check the cache and if found --> write to markupWriter using markwriter.addRaw(htmlFromCache); This gives an OOM-error since apparently Markupwriter doens't like having to construct so many dom elements all at once, 2. Better solution would be to use TextStreamResponse. However, I would like to return the html in this streamresponse in the same render methods of the component. However, I only seem to be able to return a streamresponse from an event method (such as onActivate, which seems the recommended way to render using StreamResponse) . Since a Component doesn't have a onActivate I'm out of luck. Ther is some metnion in earlier posts of using a page's onActivate to return a TextStreamResponse but I don't see how this could help me... any help is highly appreciated. Britske Britske wrote: > > currently I'm working on a page with a lot of components. > > part of these components are lists with contents related to the visitor > viewing the page (i.e: last viewed products, product in wishlist) but most > of these components display lists which are related to context of the page > only (and are thus visitor-independent.) > > Because of: > a. rather big processing time of these components > b. pretty static nature of the visitor-independent components (changes > once a night) > c. limited nr of possible contexts > > it seems a good idea to wrap all visitor-independent components in a new > 'container component' of which I would like to cache the outputted html. > > Has anybody done something like this before, and if yes how? Are there any > 'tapestry-ways' to go about it? > If not, in the basis I just need to know how to fetch the output of a > component as html, so I can insert it in memcached using the pagename+ > context as key. > > Thanks for you help, > Britske > -- View this message in context: http://www.nabble.com/t5%3A-strategy-for-caching-html-output-of-component-tp23394162p23397417.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org