Pre-Caching Layouts Upon System Restart

When a layout is first accessed, either upon a restart of the application server, or upon a change to the layout by the administrator, it is read by ExtraView, and compiled into a form that can be rendered speedily. This action may take a half-second for simple layouts to many seconds for complex layouts.

This feature is controlled by the security permission key named SE_TEMPLATE_PRECACHE.

If you do not want an end-user to face this delay when they are the first person to access a layout, you can use the utility at Fields & Layouts --> Controls pre-caching templates at system startup to compile and cache layouts when the application server is restarted.

Pre-caching Layouts

ExtraView has an overall limit of 100 layouts held in the cache at one time, and if this number is exceeded, then the oldest layout is removed from the cache. At the same time, there is a cost in time to pre-cache layouts, therefore the recommendation is to only pre-cache layouts if a user is likely to complain about the time taken to reach the layout if they are first person to use it.

To pre-cache layouts, use the filters at the top of the screen to select the layout(s) you want to cache. This will be a combination of user role, business area, project, layout type and the locale with which the layout is to be displayed. Once you select the filters, use the Add Selected Keys button to add the layouts to the pre-cache list. You can remove layouts individually using the Del button, or you can set up keys and remove a list of layouts at one time.

The caching is controlled by a system task named TEMPLATE_LOADER. This task must be started in order for the caching to take place. Go to the Manage Tasks and Threads administrative utility and Add the task. The task should be set up to run on each node of a clustered system. It is recommended that you set the poll interval to zero. This causes the task to run once upon system startup and not to be run again.

Caching layouts is somewhat tricky, as a full understanding of exactly what needs to be cached to speed up the initial load time is essential. Some recommendations:

  • Do not assume that trying to pre-cache all layouts will lead to better performance
  • Do not cache the layouts in the Master Projects for any area. Only cache the layouts in the projects that actually store the user's data
  • First cache the Add and Edit layouts for the most frequently used business areas in their data projects
  • If you have embedded layouts in the Add and Edit layouts then cache these
  • Cache the layouts only for the most frequently used roles
  • Cache the layouts only for the most frequently used locales
  • On a sizeable system, there can be many, many layouts when you look at the combination of the layouts, the business areas, the projects, the user roles and the locales. Look to cache only the most frequently used combinations, because of the limitation of being able to pre-cache 100 layouts.