Controlling stylesheet caching

In the mcs-config.xml file you can specify the way that MCS caches generated style information from theme policies.

In the mcs-config.xml file you can specify the way that MCS caches generated style information from theme policies.

Setting policy caching

If you haven't already enabled the theme-cache element in the policy-cache section of the configuration file, you must do so. Otherwise MCS will never use or cache generated style sheets, and changes made to themes are reflected immediately.

Stylesheet caching

The stylesheets generated by MCS are cached in memory. The max-age attribute on the page-level-generation element sets the maximum length of time in seconds that an entry may remain in the cache.

Note:

The max-age attribute on the style-sheets element and the internal-generation element have no effect.

Enabling external generation

Pages referring to external stylesheets are not cached, but you can enable MCS to generate external stylesheets.

To specify external style sheets, the external-generation element must be present in the configuration file. The cache and flush-on-restart attribute no longer have any effect. However the required base-directory is retained for backward compatibility, and the value must point to an existing location with a subdirectory named 'cssFileCache'. The base-url attribute points to the location of the external generation servlet.

<style-sheets>
  <external-generation
    base-directory="${MCS_HOME}/mcs/css"
    base-url="[context_root]/MCSCSS"/>
</style-sheets>
Note:

MCS will generate a small amount of inline style information for some XDIME elements such as xfforms and menu, even when you have specified external stylesheet generation.

Related topics