Configuration steps

1. Configure the external cache group on the appservers (in our case Trade3Server1, Trade3Server2 and Trade3Server3). Follow the steps outlined in WebSphere External Cache configuration and create an external cache group named "EsiInvalidator". Then add a member with these parameters: Address: Local host Adapter bean name: com.ibm.websphere.servlet.cache.ESIInvalidatorServlet

2. Configure the ESI processor.

The ESI processor is configurable through the WebSphere Web server plug-in configuration file (plugin-cfg.xml). Example 14-13 shows the beginning of this file, which illustrates the ESI configuration options.

Example 14-13 ESI configuration options in plugin-cfg.xml file

<Config>
<Property Name="esiEnable" Value="true"/>
<Property Name="esiMaxCacheSize" Value="1024"/>
<Property Name="esiInvalidationMonitor" Value="false"/>

The esiMaxCacheSize specifies the maximum size of the cache in 1 KB units. The default maximum size of the cache is 1 MB. If the cache is full, the first entry to be evicted from the cache is the entry that is closest to expiration.

The esiInvalidationMonitor parameter specifies whether or not the ESI processor should receive invalidations from the appserver.

3. In order to enable an appserver to send an explicit invalidation, the esiInvalidationMonitor property from Example 14-13 must be set to true and the DynaCacheEsi application must be installed on the application server. The DynaCacheEsi application is located in the installableApps directory and is named DynaCacheEsi.ear.

If the esiInvalidationMonitor property is set to true but the DynaCacheEsi application is not installed, then errors will occur in the Web server plug-in and the request will fail.

4. Add a cache policy in the cachespec.xml file for the servlet or JSP file you want to be cached in the edge cache. To do so, Add <property name="EdgeCacheable">true</property> for those entries, as explained in Example 14-14 for the home servlet.

Example 14-14 Cache ID for home servlet

<cache-id>
	<component id="action" type="parameter">
		<value>home</value>
			<required>true</required>
		</component>			
		<component id="JSESSIONID" type="cookie">
			<required>true</required>
		</component>	
		<property name="EdgeCacheable">true</property>
</cache-id>	

5. When WAS is used to serve static data, such as images and HTML on the appserver, the URLs are also cached in the ESI processor. This data has a default timeout of 300 seconds. You can change the timeout value by adding the property com.ibm.servlet.file.esi.timeOut to your JVM's command-line parameters.

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.