Re: Caching of rendered panels

2009-03-28 Thread Daniel Frisk
Great ideas! I think I will try to implement it is a WebComponent decorator that can wrap a component and add the caching. I'll let you know if it works out for me. // Daniel jalbum.net On 2009-03-27, at 20:40, Matej Knopp wrote: You have to be really brave to use IComponentSource :-)

Re: Caching of rendered panels

2009-03-28 Thread Igor Vaynberg
if you dont mind putting this into a wrapper there is a containertransformer or something like that. -igor On Sat, Mar 28, 2009 at 1:13 AM, Daniel Frisk dan...@jalbum.net wrote: Great ideas! I think I will try to implement it is a WebComponent decorator that can wrap a component and add the

Caching of rendered panels

2009-03-27 Thread Daniel Frisk
I have a situation where I have some panels which I want to render say at most once a minute and during that period they should be static. I tried a few approches which hasn't really worked out for me so I wanted to know if somebody has created such a thing or how this could be done. Ideas

Re: Caching of rendered panels

2009-03-27 Thread Igor Vaynberg
normally you should cache your model, the rendering itself is very cheap. -igor On Fri, Mar 27, 2009 at 8:49 AM, Daniel Frisk dan...@jalbum.net wrote: I have a situation where I have some panels which I want to render say at most once a minute and during that period they should be static. I

Re: Caching of rendered panels

2009-03-27 Thread Jeremy Thomerson
Don't share component instances across requests / especially sessions. Don't prematurely optimize. Cache your model and test the rendering. If it really is taking too long, figure out why and worry about it then. -- Jeremy Thomerson http://www.wickettraining.com On Fri, Mar 27, 2009 at 1:12

Re: Caching of rendered panels

2009-03-27 Thread Daniel Frisk
In our case it's not really that the rendering itself is taking to long, it is getting the data from the model (database) so your advice is in some sense correct. Restructuring the code so that we can efficently cache the model is a lot of work and I would prefer to somehow cache the

Re: Caching of rendered panels

2009-03-27 Thread Igor Vaynberg
ive never had to do this, but maybe something like this will work :) class myheavypanel implements icomponentsource { private String cache; public Component restoreComponent(String id) { if (cache==null) { return this; } else { return new label(id,

Re: Caching of rendered panels

2009-03-27 Thread Matej Knopp
You have to be really brave to use IComponentSource :-) It's almost never a good idea anyway. It makes sense if you have container with big amount of small component and you can restore the whole hierarchy from e.g. an entity Id. but it was last time used with Wicket 1.3. There's not guarantee