Network Deployment (Distributed operating systems), v8.0 > Administer applications and their environment > Administer Dynamic caching > Administer the dynamic cache service > Use the dynamic cache service
Configure portlet fragment caching with wsadmin.sh
You can configure portlet fragment caching with scripting and wsadmin.sh.
Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client topic for more information about starting wsadmin.sh.
If you use wsadmin.sh to enable portlet fragment caching, make sure that servlet caching is also enabled. Similarly if you use wsadmin.sh 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 admin console, synchronization is automatically taken care of for you.
Procedure
- 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/')- List the web containers and assign them to the wc variable, for example:
### Jacl
set wc [$AdminConfig list PortletContainer $s1]### Jython
wc = AdminConfig.list('PortletContainer', s1)- Set the enablePortletCaching attribute to true and assign it to the serEnable variable, for example:
### Jacl
set serEnable "{enablePortletCaching true}"### Jython
serEnable = [['enablePortletCaching', 'true']]- Enable caching, for example:
### Jacl
$AdminConfig modify $wc $serEnable### Jython
AdminConfig.modify(wc, serEnable)
Configure portlet fragment caching
Start the wsadmin scripting client using wsadmin.sh