Start the Apache Tomcat server, and then access the following URL:

Caching with Third-Party Application Servers 12-9

b. In the Action on Expired Objects section, select Remove Immediately.

2. Create a session caching rule, as described in Section 6.8.6 . When configuring a session caching rule, perform the following steps:

a. When creating a session definition in the Session Definitions section of the

Session Configuration page: In the Session Name field, enter ApacheSession. In the Cookie Name field, enter JSESSION. In the URL Post Body Parameters field, enter jsessionid. b. In the Session Policy Configuration section of the Session Configuration page, create two policies named ApacheSession: In the Cache column for the first ApacheSession policy, select the With Session option. In the Cache column for the second ApacheSession policy, select the Without Session option. Do not select the Substitute Default Value check box. c. Create a new caching rule for Session. When creating the caching rule for the SessionServlet servlet output, configure the following in the General tab of the Create Caching Rule page: Click the Cache check box. From the Expiration list, select Expire 60 seconds after cache entry and remove immediately . In the Match URL By section, select Path Prefix and enter examplesservletsSessionServlet. In the HTTP Methods section, click GET. In the Sessions tab of Create Caching Rule page, select both the ApacheSession sessions, one using setting Without Session and the other using setting With Session. 3. Create a session caching rule as described in Section 6.8.6 . 4. Point the browser to Oracle Web Cache with the following URL: http:web_cache_hostname:WebCache-adminexamplesservletsSessionServlet See Section 2.11.1.1 to determine the port. The output is the same when you accessed Session servlet directly from Apache Tomcat. This time Oracle Web Cache caches the Session servlet output. When the page is refreshed or reloaded, notice that the counter does not increment by one. This is because Oracle Web Cache serves the content, and the request never goes to the Apache Tomcat. 5. View the contents of the cache, as described in Section 8.6 , to ensure that Session servlet is cached. When you reload the page, notice that the cached response appears faster than when you access the Apache Tomcat server directly.