Re: Searched: Alternative to #include returning the processed content

Attila Szegedi <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
FreeMarker can use JSP tag libraries in templates, and there's a good  
taglib that provides caching as part of the OpenSymphony project -  
OSCache at <http://www.opensymphony.com/oscache/>. By integrating the  
OSCache into your templates using their JSP taglibs, you can achieve  
efficient caching for fragments of your output.

Attila.

--
home: http://www.szegedi.org
twitter: http://twitter.com/szegedi
weblog: http://constc.blogspot.com

On 2008.11.26., at 16:49, Alexander Reelsen wrote:

> Hello
>
> I am currently facing a problem, when using FreeMarker in  
> conjunction with
> the Alfresco CMS. I am writing a FreeMarker Template, which has to be
> pretty fast, as there will be a lot of requests in production. To  
> archive
> this, I created a few FreeMarker tags, which cache most of the  
> Alfresco
> functionality (like loading data from alfresco into freemarker,  
> which is
> quite a performance hog).
>
> In order to complete my caching framework, I would like to implement  
> some
> sort of prerendering functionality, which would be significant for the
> performance I guess.
>
> The document I am rendering consists of about 20 other documents,  
> which
> are formed as a tree, like the following one (only an example)
>
> - RootLevel
>   - L1.0
>     - L1.0.1
>     - L1.0.2
>   - L1.1
>     - L1.1.1
>   - L1.2
>     - L1.2.1
>       - L1.2.1.1
>   - L1.3
>     - L1.3.1
>     - L1.3.2
>     - L1.3.3
>     - L1.4.4
>
> You get it... This is possibly unlimited depth and I am currently  
> using
> the <#include> statement to display all the tree elements as a whole  
> tree,
> which works for displaying, but not for caching, as include  
> processes the
> template, but you cannot store the output of such a processing.
>
> I played around with ?interpret as well, but couldn't get any useful
> results either, which stored the rendered content, as you have to  
> use the
> <@interpretedVar /> notation in order the render the content (the
> interpret? only creates a model if I recall correctly).
>
> So any hints, of how to achieve a faster inclusion of my tree based
> concept would be really helpful. The most simple solution would be  
> to have
> an include, which returns the rendered text instead of processing the
> argument. Is this perhaps already somewhere built-in and I just did  
> not
> find it?
>
> Thanks for any help and take care.
>
>
> Regards, Alexander





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.