Hi Jamie, Even when using Struts there is nothing stopping you writing a custom tag lib to do a db lookup for your portals content, based I guess upon a user preference held in the session/request. You could then use the caching tags you describe.
Also remember that most dbs have very good configurable caching mechanisms of their own. Also remember that in J2EE some CMP implementations will give you some free caching (also TopLink/CocoBase etc.) You could code your own mechanism that wraps objects placed in the session with a time stamp and only look them up again if a specified time has elapsed... Judicious use of the Singleton pattern can also speed performance. Jon Ridgway -----Original Message----- From: Jamie J [mailto:[EMAIL PROTECTED]] Sent: 11 July 2002 20:51 To: [EMAIL PROTECTED] Subject: where can caching help performance? I'm wondering how people speed up their MVC webapps. Taglibs for caching parts of jsps seem like a good way of improving the speed of a web app (see: http://jakarta.apache.org/taglibs/doc/cache-doc/intro.html, http://www.opensymphony.com/oscache/tags.html, the one that comes with weblogic etc). e.g. (pseudo-tag): <foo:cache timout="5mins"> <!-- query the database and display details of the 10 most recent news items, or something --> </foo:cache> However they don't help much if you've got an MVC app, because all your database access etc happens before the view of it is rendered, as opposed to as it is rendered which is where these taglibs are useful. Is the only option with MVC to cache the data? The idea of caching the rendering of it too is appealing - if they data hasn't changed, why keep re-rendering it? (assuming everyone's view of it is the same). It is particularly appealing when you consider that it can be done with no code changes - you can put a (servlet 2.3) filter in front of servlets/jsps you wanted cached. Its portal-style applications that I'm thinking of here, where you have discrete components of a page which all may involve some database (or other timeconsuming) activity, but the data doesn't change often so the cached view of it can be updated every X-minutes or so. What approaches do people use to speed up such apps? Is caching really only an option in the model, rather than the view? (assuming its not the whole page you're caching). -- jamie __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> The contents of this email are intended only for the named addressees and may contain confidential and/or privileged material. If received in error please contact UPCO on +44 (0) 113 201 0600 and then delete the entire e-mail from your system. Unauthorised review, distribution, disclosure or other use of this information could constitute a breach of confidence. Your co-operation in this matter is greatly appreciated. -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>