According to some tips on the official website, following these steps can improve the performance of struts2. Because struts2 inherits webwork, so webwork is the same.
1. Disable Logging and devmode. devmode is set in struts. properties. To Disable Logging, modify the Web. xml file and add the following parameters.
<Servlet>
<Init-param>
<Param-Name> debug </param-Name>
<Param-value> 0 </param-value>
</Init-param>
<Init-param>
<Param-Name> detail </param-Name>
<Param-value> 0 </param-value>
</Init-param>
</Servlet>
2. Do not use interceptor unless necessary ).
3. correctly set cache-control and expires on the page
4. struts is stored by default in the Ajax theme (Dojo) or calendar tag provided by struts2. in the jar package, copying these JS or CSS files to another server can improve performance.
5. If freemarker is used, create a freemarker. properties under the classes folder under the WEB-INF and add
Template_update_delay = 60000. The value is how long freemarker reloads the template from the hard disk. The default value is 500 ms, because there is no need to check whether the template file needs to be reloaded, so it is best to set it to a large number.
6. Enable freemarker template cache. this parameter is set to true for struts. freemarker. templatescache. By default, this parameter is set to false.
7. Save the use of sessions. Do not use sessions unless necessary.