21.4 Template Caching

Template caching options are useful for speeding up template response times. Specifically, for Portal Templates for items, caching speeds up the dynamic assembly of the item within the context of its Portal Template.

Template caching options are not available for Portal Templates for pages. Pages based on templates use their own caching option not the template's caching option. See Section 21.1, "Page Caching".

This section describes template caching options and how to apply them. It includes the following sub-sections:

21.4.1 Changing How a Portal Template Is Cached

Portal Template caching options display only for Portal Templates for items. A Portal Template for items is a Portal Template that contains an Item Placeholder item type. For Portal Templates for items, template caching options control the caching level of the template definition and template content.

Note:

If, in a Portal Template for items, the item placeholder is deleted, hidden, or expired, caching options nonetheless continue to display on the Main tab. They display until the item is thoroughly removed through a system purge.

To change how Portal Templates for items are cached:

  1. From the Page Groups portlet Work In drop-down list, select the page group that owns the Portal Template for items.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page.

  2. Under Portal Templates in the Layout & Appearances section, click the link to the Portal Template for items.

    This opens the template in Edit mode.

  3. Click the Template: Properties link at the top of the page.

  4. Click the Main tab to bring it forward.

  5. Select a template caching option.

    See Section 21.4.2, "Portal Template Caching Options" for a description of each caching option.

  6. Click OK to save your changes and return to the template.

21.4.2 Portal Template Caching Options

Table 21-4 lists and describes the template caching options (Edit Portal Template: Main tab):

  • Cache Template Definition Only at User Level

  • Cache Template Definition and Content at User Level for [ ] Minutes

  • Cache Template Definition Only at System Level

  • Cache Template Definition and Content at System Level for [ ] Minutes

  • Don't Cache

Table 21-4 Template caching options

Option Description

Cache Template Definition Only at User Level

Caches the template definition for each user, in both Oracle Web Cache and the Portal Cache. The definition includes:

  • Metadata describing the template structure

  • Identification of any portlets on the template

  • Items that exist on the template

  • Identification of styles used on the template

Choose this option for templates with dynamic portlet content and where the template definition is user specific. For example, user specific template definitions might contain:

  • Items with item level security

  • Navigation items: Page Link, Page Path, Login/Logout Link

  • Portal Smart Link items: Edit, Personal Page

  • Portal Smart Text: Current User

This option eliminates template definition regeneration on every request by a user. The template definition is generated the first time a user accesses the template. However, portlet content is retrieved and the template is assembled on each request. This allows the template to display dynamic portlet content.

Note that:

  • Storing data for each user can impact storage and performance.

  • It is not necessary to choose this option when your template contains portlet content that is user specific. You can specify the caching level of portlets separately, at the portlet instance level. See Section 21.3, "Portlet Caching".

  • Even if the template content is user specific because it contains secure tabs, the template definition is not user specific because these are cached at the user level, separately from the template definition.

Cache Template Definition And Content at User Level For [ ] Minutes

Caches the template definition (as described in the previous option), and the assembled template's content, including all portlet content, for a specified period of time, for each user. This is called user-level expiry-based caching.

Choose this option for template with portlets that do not change within the specified time period and where the template content (either the template definition or portlet content) is user specific.

Note that:

  • This option reduces load on the Parallel Page Engine and Oracle Portal middle-tier servers and improves performance. It eliminates assembly of the template content and regeneration of the template definition and portlet content on every request by a user. However, expiry-based caching caches the portlet content in the assembled template and therefore some portlet content may be stale when the template is retrieved from the cache.

  • Fully-assembled templates are cached in Oracle Web Cache and the browser, but not in the Portal Cache.

  • When the template definition changes, the cached, fully-assembled template in Oracle Web Cache is invalidated.

  • If the template includes a Refresh Smart Link (either directly in the template or within a navigation page portlet in the template), the link will be displayed to logged-in users. When you click this link, the template is regenerated from the database.

Cache Template Definition Only at System Level

Caches the template definition once for all users. The template definition is the same for all users and includes:

  • Metadata describing the template structure

  • Identification of any portlets on the template

  • Items that exist on the template

  • Identification of styles used on the template

Choose this option for template with dynamic portlet content, where the template definition is the same for all users.

This option greatly reduces storage requirements and improves performance. It eliminates regeneration of the template definition on every request, by any user. The template definition is generated the first time any user accesses the template. The portlet content is retrieved and the template is assembled on each request and this allows the template to display dynamic portlet content.

This option can be used when:

  • Portlet content is user specific - The cache level of portlets on the template can be specified separately at the portlet instance level. See Section 21.3, "Portlet Caching".

  • Template contains secure tabs- These are cached at the user level, separately from the template definition.

Do not choose this option when:

If template performance is critical, you might use this option if the template definition contains certain user specific items:

- Items with item level security

- Navigation items: Page Link, Page Path, Login/Logout

- Portal Smart Link items: Edit

- Portal Smart Text: Current User

If you do this, the items are displayed the same to all users, regardless of their access privileges. Whilst this is not ideal visually, users can still perform only the actions for which they have the appropriate access privileges.

Cache Template Definition and Content at System Level for [ ] Minutes

Caches the template definition (as described in the previous option), and the assembled template's content, including all portlet content, for a specified period of time, for all users. This is called system-level expiry-based caching.

Choose this option for templates with portlets that do not change within the specified time period and where the template content (both the template definition and portlet content) is the same for all users.

Note that:

  • The template is not dynamically assembled when any user requests the template, so this is the best choice for minimizing the load on the Parallel Page Engine and Oracle Portal middle-tier servers. However, expiry-based caching caches the portlet content in the assembled template, so some content may be stale when the template is retrieved from the cache.

  • Fully-assembled templates are cached in Oracle Web Cache and the browser, but not in the Portal Cache.

  • When the template definition changes, the cached, fully-assembled template in Oracle Web Cache is invalidated.

  • If the template includes a Refresh Smart Link (either directly in the template or within a navigation page portlet in the template), the link will be displayed to logged-in users. When you click this link, the template is regenerated from the database.

Do not choose this option when:

  • Content must display differently based on the user - A single copy of the template is displayed to all users. Portlets display only public content. All of the template's tabs and items are displayed to all users. Users can still perform only the actions for which they have the appropriate access privileges.

  • Approvals and notifications are enabled - System level caching is not appropriate for approval-enabled templates, as these templates are not expected to display the same content to all users. See also Section 5.4.2, "Enabling Approvals and Notifications for a Page Group".

Don't Cache

Disables template caching. With this option you do not gain any of the performance benefits provided by caching.

The use of this option will adversely impact portal performance. Do not use this option except where absolutely necessary. Do not use this option on frequently accessed templates. Keep the number of templates that require this option to a minimum.

You may want to disable template caching in the following circumstances:

  • Your template contains PL/SQL items or URL items that are displayed in place (that is, they are displayed directly on the template) and that produce dynamic content that must always be up-to-date (a portlet that is not cached or that uses a short expiry would be a better choice for this kind of content).

  • You are concerned that a soft-invalidation event, such as a change to user group membership, may result in a cached version of a template being viewed by an active user who has recently lost his privileges on pages that use the template.


21.4.3 Clearing the Cache for a Portal Template

You can manually clear the cache entries associated with a Portal Template. For example, this might be useful if you revoke a user's privileges on an item associated with a template and you want to make sure that your privilege level changes are applied immediately. If you do not clear the cache, the user will still be able to access the item if the template is in the cache.

To clear the cache for a Portal Template:

  1. From the Page Groups portlet Work In drop-down list, select the page group that owns the Portal Template.

    By default, the Page Groups portlet is located on the Build tab of the Portal Builder page.

  2. Under Portal Templates in the Layout & Appearances section, click the link to the Portal Template.

    This opens the template in Edit mode.

  3. Click the Template: Properties link at the top of the page.

  4. Do one of the following:

    • (Portal Template for items only) Click the Main tab, and select Clear Cache.

    • (Portal Template for pages and items) Click the Access tab, and select Clear Cache.

  5. Click OK to return to the Portal Template.