+

Search Tips   |   Advanced Search

 

Configure portlet fragment caching with the wsadmin tool

 

You can configure portlet fragment caching with scripting and the wsadmin tool.

Before starting this task, the wsadmin tool must be running. See the Start the wsadmin scripting client article for more information.

 

Overview

If you use the wsadmin tool to enable portlet fragment caching, make sure that servlet caching is also enabled. Similarly if you use the wsadmin tool to disable portlet fragment caching, make sure that servlet caching is also disabled. The settings for these two caching functions must stay synchronized. If you enable or disable portlet fragment caching using the console, synchronization is automatically taken care of for you.

 

Procedure

  1. Locate the server object. The following example selects the first server found:

    Use Jacl:

    set s1 [$AdminConfig getid /Server:server1/]
    

    Using Jython:

    s1 = AdminConfig.getid('/Server:server1/')
    
    

  2. List the Web containers and assign them to the wc variable, for example:

    Use Jacl:

    set wc [$AdminConfig list PortletContainer $s1]
    

    Using Jython:

    wc = AdminConfig.list('PortletContainer', s1)
    

  3. Set the enablePortletCaching attribute to true and assign it to the serEnable variable...

    Use Jacl:

    set serEnable "{enablePortletCaching true}"
    

    Using Jython:

    serEnable = [['enablePortletCaching', 'true']]
    

  4. Enable caching...

    Use Jacl:

    $AdminConfig modify $wc $serEnable
    

    Using Jython:

    AdminConfig.modify(wc, serEnable)
    



Configure portlet fragment caching