Reputation: 9544
We have a page in which the main content area is controlled by ui:includes
, basically we have a h:panelGroup
with a rendered
condition and the ui:include
inside of it.
Like this:
<h:panelGroup rendered="#{bean.page.id eq bean.page1ID}">
<ui:include src="page.xhtml"/>
</h:panelGroup>
We have about 10 of those. Each page is pretty complex, having a few beans of their own. The reason we are doing the rendered trick instead of a dynamic ui:include
is because there is a bug in which the @ViewScoped
beans used outside the ui:include
get re-instantiated inside the ui:include
thus causing all sorts of issues.
Any time we perform some action it takes several seconds (7 to 15 usually) for the action to be performed. For example when we change the bean.page
property and request a render. Even when we do something simple like saving a value which doesn't involve hardly anything else it is really slow. If I remove all the h:panelGroups
and ui:includes
except for one then the site is really fast (1 to 2 second response). As far as I can tell all the pages in the ui:includes
and the beans they use are getting instantiated.
What can we do to speed this up? we are using mojarra 2.1.13 on resin 4.0.32 and primefaces 3.5.
Thanks.
Upvotes: 4
Views: 644
Reputation: 1595
Do you have any custom context parameters? Wrong values there can significantly influence the performance.
You could try to disable the facelets refresh in your web.xml
:
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>-1</param-value>
</context-param>
Setting this value to -1 disables the internal check for view declaration changes. This means that you cannot reload your xhtml pages without a redeploy but it also means higher performance.
Alternatively, you could also try to set the project stage to Production
(this should include the other parameter). This disables lots of additional checks and stuff for development:
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
</context-param>
Those two settings should always be used in a productive environment.
Upvotes: 1