+

Search Tips   |   Advanced Search

Configure portlet fragment caching with the wsadmin tool

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

See the Starting the wsadmin scripting client topic for more information about starting the wsadmin tool.

If we use the wsadmin tool to enable portlet fragment caching, make sure that servlet caching is also enabled. Similarly if we 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 we enable or disable portlet fragment caching using the administrative console, synchronization is automatically taken care of for you.


Tasks

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

    Use Jacl:

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

    Use 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]
    

    Use Jython:

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

  3. Set the enablePortletCaching attribute to true and assign it to the serEnable variable, for example:

    Use Jacl:

    set serEnable "{enablePortletCaching true}"
    

    Use Jython:

    serEnable = [['enablePortletCaching', 'true']]
    
  4. Enable caching, for example:

    Use Jacl:

    $AdminConfig modify $wc $serEnable
    

    Use Jython:

    AdminConfig.modify(wc, serEnable)
    

  • Configure portlet fragment caching
  • Start the wsadmin scripting client