struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dekany (Commented) (JIRA)" <>
Subject [jira] [Commented] (WW-3765) Improve performance of FreeMarker Template caching
Date Sun, 26 Feb 2012 08:54:48 GMT


Daniel Dekany commented on WW-3765:

If you set the delay to a sufficiently large value, such as Integer.MAX_VALUE, reloading should
never occur due to the update delay (unless you run the server for 70 years). You can still
have re-loadings however, if cache drops cached templates because the GC decides so. This
can be prevented with using sufficiently large "hard" size in MruCacheStroage.

(I surely hope you don't have a dead locks. That's when something freezes indefinitely because
threads waiting on each other mutually.)
> Improve performance of FreeMarker Template caching
> --------------------------------------------------
>                 Key: WW-3765
>                 URL:
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Integration
>    Affects Versions: 2.3.1
>         Environment: Tomcat v7.0
>            Reporter: Vijayakannan
>            Priority: Critical
>              Labels: freemarker-template-reload-required
>             Fix For: 2.3.2
>   Original Estimate: 24h
>  Remaining Estimate: 24h
> Struts2 having option to enable the freemarker template caching with reloading the template
with time delay which helps us to improve the performance.
> In our application we are using the strut2 in-built UI freemarker template. We need the
caching option without reloading the templates after the specific time delay.
> Caching option is more powerful if we have an option for enabling\disabling the reload
> Proposed Solution 
> Struts.xml
> <constant name="struts.freemarker.templatesCache.required" value="true"/>
> protected boolean templateUpdateRequired;
> public void setTemplateUpdateRequired(String templateUpdateRequired) {
> 		this.templateUpdateRequired ="true".equals(templateUpdateRequired);
> 	}
> Update createConfiguration(ServletContext servletContext) Method
>    configuration.setSetting(Configuration. TEMPLATE_RELOAD_ REQUIRED _KEY, templateUpdateRequired);
>   String TEMPLATE_RELOAD_ REQUIRED _KEY= "template_reload_required";
> TemplateCache.Java
>   protected boolean templateUpdateRequired;
> Update getTemplate(TemplateLoader loader, String name, Locale locale, String encoding,
boolean parse) Method
> ...
> if (templateUpdateRequired !=false && now - cachedTemplate.lastChecked < delay)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message