WSRP Markup Caching
The WSRP implementation in the portal uses expiry-based markup caching for remote portlets to improve performance. This reduces the number of interactions between the Consumer and the Producer and enables the use of remote caches for pages containing remote portlets. We can disable this feature if required.Markup caching for remote portlets is performed automatically and does not require any WSRP configuration. The Consumer caches remote portlet content in the dynamic fragment cache based on the cache-control data structure that the Producer provides as part of its response.
The Producer derives the WSRP cache control from the cache settings of the local standard API portlet. These settings are specified statically in the portlet definition or dynamically through the Portlet API during run time. They comprise the following information:
- Expiration specifies the duration in seconds that markup fragment remains valid. A value of -1 indicates that the markup fragment will never expire.
If an expiration value of -1 is specified the Consumer and all remote caches will cache the content for unlimited time. This means that the content will never be updated.
- Scope specifies a string indicating when the cached markup may be used by various users. The markup is either cached specifically for one user or for all users. Relevant for remote caching. Refer to the section about tuning the portal.
If the local portlet is not a standard API portlet, the Producer does not return any cache control information and thereby disables caching for this portlet.
Both the Producer and the Consumer can configure WSRP markup caching using the following portal service configuration parameter in the portal Configuration Service:
- wsrp.caching.enabled = (true)
- Enable or disable WSRP markup caching. The default for this parameter is true. This means that WSRP markup caching is enabled, if no value is specified for this parameter.
If the Producer has set this parameter to true, then the caching information is passed to the Consumer portal on each request. If the Consumer has also set this parameter to true, then the Consumer portal performs caching according to the information received from the Producer portal for the portlet.
If either the Producer or the Consumer has set this parameter to false, no caching is performed. We can set this parameter in the portal Config Service using the WAS admin console.