From: Lane S. <la...@op...> - 2004-05-24 13:57:04
|
Hi Lars, For the application you describe below, typically you will have a nested set of caches for the output. Capturing the output from an evaluation is pretty easy: String value = wmCache.getValue(webContext) if (value == null) { value = template.evaluate(); wmCache.put(webContext, value); } The above is an outline; there are many other factors to consider such as the session and so forth (is the content evaluated differently for different users, etc, etc, etc). Let me know if this helps. -Lane Lars George wrote: > Hi Lane, > > With that caching provider, how would you cache a separate piece of > content, which is part of the overall page. I assumed providers are > for resources, like templates, which means the whole template is > cached. Also, where is the distinction between caching the parsed > content and caching the actual output. See, I do not want to cache the > query results but use them to create the content and cache that instead. > > I trust you meant that somehow but I am not sure about it. Also, would > you be able to tell me which classes are involved? > > Thanks, > Lars > > > Lane Sharman wrote: > >> Hi Lars, >> >> Caching has been discussed a lot and there is a caching provider >> interface so you can write your own caching implementation. (As I >> have done). >> >> To cache individual objects, you can use a global service model to >> cache individual templates (eg, connection.wmt, statements.wmt, etc.) >> and objects (queryResultReference, queryResultDomain, >> queryResultTransaction, etc). With this kind of a model, you cache >> both the template elements and the results according to memory and >> invalidation events. >> >> I have done all of the above for http://www.opendoors.com >> >> Good luck. >> >> Kindest, >> >> lane >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Webmacro-user mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/webmacro-user > -- Lane Sharman Providing Private and SPAM-Free Email http://www.opendoors.com 858-755-2868 |