Couldn't you just override the control's render method? Something
along the lines of:
Public class myCache() {
Public static final String fData;
Public static put(String data) {
fData = data;
}
Public static get() {
Return fData;
}
Public static flush() {
fData = null;
}
}
Then in your render method:
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
String cached = myCache.get();
If (cached != null) {
Writer.print(cached);
} else {
// render component into a string buffer instead of the
stream
myCache.put(buffer);
writer.println(buffer.toString());
}
}
-----Original Message-----
From: Michael Musson [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 24, 2005 1:51 PM
To: [email protected]
Subject: Cache control results?
I have a control that must do some intensive calls in order to render
itself. The actual content of the control will normally render
unchanged from call to call. There are only a few well defined spots
that could change the content of the control.
Ideally I would like to have the control save a copy of its output and
return this on renders until I call a method to clear the cache in
which case the control would redo the calls necessary to render
itself.
Is there a way to do caching like this directly in Tapestry or do you
have recommendations or the best way to do this within Tapestry?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]