Using Lawson cache in SForms

Caching in memory of certain data retrieved from the server has always been a feature of ISO Lawson to enhance performance. It has become apparent over time that the amount of data can be very large and thus negatively impact performance by consuming large amounts of memory. To alleviate this problem, two new caching features are added.

Cache to disk

The role General setting Allow user cache settings provides the user with the ability to cache the largest data sets (form XML, field help XML, form context message XML and FileView, or table definition XML) to disk.

The role Options setting Cache level is also added to allow administrators to force a certain cache level for members of a role. Like other options, this can be disabled from user change, though by clearing the Allow user cache settings, the user will not have the ability to make a change.

The cache level settings (which only apply to the three large data sets) available are:

  • Never cache - no caching of the large data sets will occur. Use of this setting will certainly increase network traffic and impact server utilization.

  • Always cache - the large data sets will be cached to a folder of the user's choice (or default location if the user is not allowed to see settings) and persist over each Smart Office session. Use of this setting will require periodic clearing of the cache, for example on an applications upgrade, to ensure the correct data is presented.

  • Session cache - the large data sets will be cached to a temporary folder managed by ISO and be cleared when the user logs out of Smart Office. Use of this setting ensures that the correct data is always retrieved but does require server access on first use of a particular form or list.

If the user is allowed to see cache settings, a new tab will appear in the User Settings dialog. On this tab, the user will be allowed to set the cache level if not restricted by the Role Option. A change to the cache level will take effect the next time the user logs into Smart Office. A cache folder can be selected if the user’s level is set to "Cache Always". The current cache contents for each of the three large data sets are displayed in the tab control, and the user can delete items selectively or clear the entire cache.

Central cache manager

The remaining types of data that are cached, such as form and list personalizations and a few others, will be managed by a central memory cache manager that has no visible component. This is a .NET supplied object that will constantly monitor memory consumption, and if it reaches a critical state, it unloads the oldest objects it has in cache.

The role General setting Max Cache Size is provided to set the maximum percentage of available memory that the manager will use. The default is 50 percent. If that threshold is reached, the oldest objects in memory will be released. Objects in cache that are not referenced for 1 hour will also be released.