Search code examples
jspjsffacelets

JSF pages performance with large no. of page fragments combined using ui:include


Does jsf caches the html version of the pages or generate it at runtime on each request request. I am trying to figure out that if I break my page into many many small page fragments and combine them using ui:include or use ui:define with page templates, then Is the performance affected(gets slower because of runtime transformation)?


Solution

  • JSF generates the page each time it is requested. It wouldn't make sense to cache it since they are meant to be dynamic and the HTML version may be different every time it is requested. I don't see that using ui:includes would decrease performance. Whether it's all in one file or spread over a few files, JSF needs to traverse the entire component tree during every request. The only overhead I can think of is opening the extra files and that wouldn't be noticeable. We use about 5 or so ui:includes in our main template and have no problems.