You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2007/03/16 14:04:55 UTC
[S2 Tip] Always set devMode to false in production
In the Struts 2.0.6 release, we made the mistake of setting devMode to
true in some of the example applications. As a result, some developers
copied the setting, and then wondered why their Struts 2 application
seemed sluggish!
As of Struts 2.0.7 (coming soon), we've added a Performance Tuning
page to the documentation. Here's the highlights:
* Turn off logging and devMode
* Do not use interceptors you do not need
* Use the correct HTTP headers (Cache-Control & Expires)
* Copy the static content from the Struts 2 jar when using the Ajax
theme (Dojo) or the Calendar tag
* Create a freemarker.properties file in your WEB-INF/classes directory
* Copy the /template directory from the Struts 2 jar in your WEB_APP root
* When overriding a theme, copy all necessary templates to the theme directory
* Do not create sessions unless you need them
* When using FreemarkerResult, try to use the Freemarker equivalent
rather than using the JSP tags
For the nitty-gritty, visit the latest version of the page :
* http://struts.apache.org/2.x/docs/performance-tuning.html
Kudos to Philip Luppens for starting the tuning page. If you have any
tuning tips of your own, feel free to post comments directly to the
page. (Gotta love Confluence!)
-- HTH, Ted
<http://www.husted.com/ted/blog/>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2 Tip] Always set devMode to false in production
Posted by Eric Rank <er...@lo-fi.net>.
Thanks for the clarification, Laurie. That's what I suspected, but
wasn't sure. Now I know!
Thanks,
Eric
> The 'templates' directory should be a sibling of WEB-INF.
>
> L.
>
> Eric Rank wrote:
>> All of these tips are great. I'm glad this page exists.
>> I'd love a bit of clarification about the location of the template
>> directory, however. I could be the only one, but I find it a
>> little confusing.
>>> * Copy the /template directory from the Struts 2 jar in your
>>> WEB_APP root
>> Does "WEB_APP root" mean that "template" should be a sibling of
>> the "WEB-INF" directory (I suspect it does) or does it mean that
>> the "template" directory should go in the "WEB-INF/classes"
>> directory, or somewhere else?
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2 Tip] Always set devMode to false in production
Posted by Laurie Harper <la...@holoweb.net>.
The 'templates' directory should be a sibling of WEB-INF.
L.
Eric Rank wrote:
> All of these tips are great. I'm glad this page exists.
>
> I'd love a bit of clarification about the location of the template
> directory, however. I could be the only one, but I find it a little
> confusing.
>
>> * Copy the /template directory from the Struts 2 jar in your WEB_APP root
>
> Does "WEB_APP root" mean that "template" should be a sibling of the
> "WEB-INF" directory (I suspect it does) or does it mean that the
> "template" directory should go in the "WEB-INF/classes" directory, or
> somewhere else?
>
> Thanks for the help.
>
> Eric Rank
>
>
>
> On Mar 16, 2007, at 7:04 AM, Ted Husted wrote:
>
>> In the Struts 2.0.6 release, we made the mistake of setting devMode to
>> true in some of the example applications. As a result, some developers
>> copied the setting, and then wondered why their Struts 2 application
>> seemed sluggish!
>>
>> As of Struts 2.0.7 (coming soon), we've added a Performance Tuning
>> page to the documentation. Here's the highlights:
>>
>> * Turn off logging and devMode
>> * Do not use interceptors you do not need
>> * Use the correct HTTP headers (Cache-Control & Expires)
>> * Copy the static content from the Struts 2 jar when using the Ajax
>> theme (Dojo) or the Calendar tag
>> * Create a freemarker.properties file in your WEB-INF/classes directory
>> * Copy the /template directory from the Struts 2 jar in your WEB_APP root
>> * When overriding a theme, copy all necessary templates to the theme
>> directory
>> * Do not create sessions unless you need them
>> * When using FreemarkerResult, try to use the Freemarker equivalent
>> rather than using the JSP tags
>>
>> For the nitty-gritty, visit the latest version of the page :
>>
>> * http://struts.apache.org/2.x/docs/performance-tuning.html
>>
>> Kudos to Philip Luppens for starting the tuning page. If you have any
>> tuning tips of your own, feel free to post comments directly to the
>> page. (Gotta love Confluence!)
>>
>> -- HTH, Ted
>> <http://www.husted.com/ted/blog/>
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [S2 Tip] Always set devMode to false in production
Posted by Eric Rank <er...@lo-fi.net>.
All of these tips are great. I'm glad this page exists.
I'd love a bit of clarification about the location of the template
directory, however. I could be the only one, but I find it a little
confusing.
> * Copy the /template directory from the Struts 2 jar in your
> WEB_APP root
Does "WEB_APP root" mean that "template" should be a sibling of the
"WEB-INF" directory (I suspect it does) or does it mean that the
"template" directory should go in the "WEB-INF/classes" directory, or
somewhere else?
Thanks for the help.
Eric Rank
On Mar 16, 2007, at 7:04 AM, Ted Husted wrote:
> In the Struts 2.0.6 release, we made the mistake of setting devMode to
> true in some of the example applications. As a result, some developers
> copied the setting, and then wondered why their Struts 2 application
> seemed sluggish!
>
> As of Struts 2.0.7 (coming soon), we've added a Performance Tuning
> page to the documentation. Here's the highlights:
>
> * Turn off logging and devMode
> * Do not use interceptors you do not need
> * Use the correct HTTP headers (Cache-Control & Expires)
> * Copy the static content from the Struts 2 jar when using the Ajax
> theme (Dojo) or the Calendar tag
> * Create a freemarker.properties file in your WEB-INF/classes
> directory
> * Copy the /template directory from the Struts 2 jar in your
> WEB_APP root
> * When overriding a theme, copy all necessary templates to the
> theme directory
> * Do not create sessions unless you need them
> * When using FreemarkerResult, try to use the Freemarker equivalent
> rather than using the JSP tags
>
> For the nitty-gritty, visit the latest version of the page :
>
> * http://struts.apache.org/2.x/docs/performance-tuning.html
>
> Kudos to Philip Luppens for starting the tuning page. If you have any
> tuning tips of your own, feel free to post comments directly to the
> page. (Gotta love Confluence!)
>
> -- HTH, Ted
> <http://www.husted.com/ted/blog/>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org