Component Profile

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:

<application>

<application-config/>

<components>

<component name= "session" >

<component-config>

<property name= "ClassName" value= "myApp.myCompnent" />

</component-config>

<component-profile>

<property name= "CachingLevel" value= "Session" />

<property name= "ValidityPeriod" value= "2000" />

</component-profile>

</component>

</components>

</application>