Entering content frame

Background documentation Portal Runtime Cache Locate the document in its SAP Library structure

The PRT implements a memory cache. This cache is used to store and retrieve the content of components that have to be cached. In this case, only the content of the request of type “content” are stored in the cache.

You have two ways of deciding when and how a portal component needs to cache content:

·        Configure the portal component by selecting a set of properties in the profile

·        Using the Portal Runtime API to control the validity and the granularity of the cache

In this case, the component needs to change its implementation and implement the ICachablePortalComponent interface.

Properties

One property identifies the level where the cache needs to be placed by adding the CachingLevel property in the component profile. The following values are permitted:

·        None

The default value. The component is not cached

·        Shared

The cache content is shared among all the users (one JVM)

·        User

The content is private for each user

·        Session

The content of the component 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

Another property provides information about the validity of the cache. The property ValidityPeriod indicates the validity of the cache in milliseconds. The cache is invalidated every ValidityPeriod lap, no matter if there is a request or not. If nothing is supplied for this property or the value supplied is –1 then the cache will never expire.

Example

Example of portalapp.xml, component with CachingLevel Session and with ValidityPeriod of two seconds:

<application>

   <application-config/>

   <components>

   <component name="session">

      <component-config>

         <property name="ClassName"  value="com.sapportals.portal.prt.component.CacheTester"/>

      </component-config>

      <component-profile>

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

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

      </component-profile>

   </component>

   </components>

</application>

 

 

Leaving content frame