Tag: pageLayoutWidgetCache

The wcpgl:pageLayoutWidgetCache tag sets the do-not-consume attribute value of the widget cache entry to false when a dependency ID with the name ignoreDoNotConsume is found in the cache definition.

This tag is used to help determine whether to consume the widget for caching. When a cache entry exists for a widget within the cachespec.xml, the default value for the do-not-consume attribute is true and the default value for the do-not-cache attribute is also true. The widget JSP fragment is not cached. If you include the wcpgl:pageLayoutWidgetCache tag in the JSP file for a widget, the class for this tag dynamically sets the widget JSP fragment to be consumed when the dependency IDs defined for the cache entry contain a dependency ID with the name ignoreDoNotConsume.

You can set widgets with static content to be consumed by their parent pages. When a widget is consumed, the widgets dependency IDs must be added to the parent page cache entry. These dependency IDs cause the cached parent page to be invalidated whenever the contents of the widget are modified. For this process to be achieved, any consumable widget must contain a special tag within its JSP:
<wcpgl:pageLayoutWidgetCache/>
When the widget JSP executes, the associated tag handler class checks for the presence of the ignoreDoNotConsume dependency ID. If present, the do-not-consume attribute is reset to false, enabling the widget to be consumed by the parent page. It also adds the dependency ID of this widget values to that of the parent page.

For more information about Commerce Composer caching, see Commerce Composer widget caching and invalidation.

Tag information

Tag information
Body Content empty

There are no attributes that are defined for the pageLayoutWidgetCache tag.

EXAMPLE

To use this tag to identify that a widget is to be consumed by the store page it is included within, specify the tag with the following format in the top-level JSP file for a widget:
<wcpgl:pageLayoutWidgetCache/>