+

Search Tips   |   Advanced Search

Set portlet fragment caching with wsadmin


Configure portlet fragment caching with scripting and the wsadmin tool.

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

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

 

  1. Locate the server object.

    The following example selects the first server found:

    Jacl...

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

    Jython...

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

  2. List the Web containers and assign them to the wc variable...

    Jacl...

    set wc [$AdminConfig list PortletContainer $s1]

    Jython...

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

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

    Jacl...

    set serEnable "{enablePortletCaching true}"

    Jython...

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

  4. Enable caching...

    Jacl...

    $AdminConfig modify $wc $serEnable

    Jython...

    AdminConfig.modify(wc, serEnable)

 

Related tasks


Set portlet fragment caching