Show TOC

Background documentationComponent Profile Locate this document in the navigation structure

 

The following table describes the profile properties that you can define in the deployment descriptor - in the <component-profile> element for your component - in order to control the caching of your component's content:

Property

Description

CachingLevel

Indicates the type of cache, as follows:

  • None (default): The component is not cached.

  • Shared: The component's content is cached and the cache is shared among all the users.

  • User: The component's content is cached separately for each user.

  • Session: The component's content is cached all the time the (servlet) session is running, whether or not a user is connected. This level is used to cache information related to the browser's sessions.

ValidityPeriod

Indicates how long the cache is valid, in milliseconds.

-1 indicates the cache never expires.

ALLOW_BROWSER

Indicates if browser caching is used:

  • Yes (default): Browser caching enabled.

  • No: Browser caching disabled, for cases where you do not want to store cache locally.

  • BrowserOnly: Only browser caching is used; server stores only cache meta-data.

The following is a deployment descriptor that defines a component with a CachingLevel of session and ValidityPeriod of 2 seconds:

Syntax Syntax

  1. <application>
  2.   <application-config/>
  3.   <components>
  4.     <component name="session">
  5.       <component-config>
  6.         <property name="ClassName" value="myApp.myCompnent"/>
  7.       </component-config>
  8.       <component-profile>
  9.         <property name="CachingLevel" value="Session"/>
  10.         <property name="ValidityPeriod" value="2000"/>
  11.       </component-profile>
  12.     </component>
  13.   </components>
  14. </application>
End of the code.