Always use the newest MyFaces version (As you can read here: Blog Entry)

If you just need a plain servlet container, use Tomcat instead of Jetty

Use JUEL as EL implementation

Add the newest JUEL API + implementation as depedency



Configure MyFaces to use JUEL:

<context-param> <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name> <param-value>de.odysseus.el.ExpressionFactoryImpl</param-value> </context-param>

Increase expression cache in JUEL

Create src/main/resources/el.properties

Add property javax.el.cacheSize with a custom size. The default size is 1000. In my application i use a size of 3000.

If you use CDI, consider to use OpenWebBeans as implementation and configure this in your web.xml:

<context-param> <param-name>org.apache.myfaces.EL_RESOLVER_COMPARATOR</param-name> <param-value>org.apache.myfaces.el.unified.OpenWebBeansELResolverComparator</param-value> </context-param>

Enable MyFaces EL caching as described in MyFaces Wiki

Disable JSP support in MyFaces:

<context-param> <param-name>org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL</param-name> <param-value>false</param-value> </context-param>

Other params to increase performance:

<context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Production</param-value> </context-param> <context-param> <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name> <param-value>-1</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.CHECK_ID_PRODUCTION_MODE</param-name> <param-value>false</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.VIEW_UNIQUE_IDS_CACHE_ENABLED</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>org.apache.myfaces.SAVE_STATE_WITH_VISIT_TREE_ON_PSS</param-name> <param-value>false</param-value> </context-param>

Configure state management as described in MyFaces Wiki

Use a custom ServletFilter to set the correct expires/cache headers of your resources (images, stylesheets, javascripts)

Compress and optimize your Javascripts in your build process. If you use maven, try primefaces-extensions' closure compiler maven plugin

Attention: If you set this, you need to provide the "org.apache.myfaces.EXPRESSION_FACTORY" parameter.