ESI --esi--Tag ESI Tag Descriptions

12-2 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache

12.1.1 Web Site Configuration

You configure Oracle Web Cache to communicate with a third-party application Web server the same way you do with Oracle HTTP Server, by providing the host name and the listening port number. Table 12–1 shows the default values for the listening ports for the products discussed in this appendix. To configure Oracle Web Cache to communicate with a third-party application Web server, perform the following tasks: 1. See Section 2.11.1 to change Oracle Web Cache port settings 2. See Section 2.11.2 configure application Web server settings 3. See Section 2.11.3 and Section 2.11.4 configure Web site settings

12.1.2 Caching Rules and Expiration Rules

You assign caching rules and expiration rules when using third-party application Web servers in the same way as when using Oracle HTTP Server. You can choose to cache or not to cache content for the following: ■ Static objects ■ Multiple-version objects for the same URL ■ Pages supporting a session cookie or embedded URL parameter ■ Pages containing simple personalization ■ Dynamic assembly of Edge Side Includes ESI fragments You can also assign an expiration time limit to objects or invalidate objects at any time. See Chapter 6, Caching and Compressing Content, and Chapter 7, Invalidating Content.

12.2 IBM WebSphere

When Oracle Web Cache fetches static content from IBM Websphere Application server, the IBM Websphere Application Server sends a content=ESI1.0+ directive in the Surrogate-Control response header in the response to the Oracle Web Cache Surrogate-Capability: orcl=ESI1.0 request. Oracle Web Cache ignores the ESI1.0+ features to get rid of page rendering issues and errors. If Oracle Web Cache is deployed as a caching solution, this difference in the control directive value may result in undefined Web application behavior. Follow these steps to force IBM Websphere Application Server to send ESI1.0 instead of ESI1.0 or later:

1. In the WebSphere Application Server administrative console, navigate to Servers

Application servers. The Application servers page appears. Table 12–1 Third-Party Application Web Server Default Listening Ports Application Web Server Port IBM WebSphere Application Server, Version 6.0 80 Apache Tomcat, Version 4.1 8080 Microsoft IIS 6.0 80 Caching with Third-Party Application Servers 12-3 2. In the Application servers page appears, select the server1 application server. server1 is the server name when IBM Websphere Application Server is installed with default options. If you specified a different name, select that name instead.

3. In the Server Infrastructure section of the Configuration tab, select Java and

Process Management , and then Process Definition. 4. In the Additional Properties section, select Java Virtual Machine, and then Custom Properties .

5. Click New to create an entry.

6. In the Name field, enter com.ibm.servlet.file.esi.control.

7. In the Value field, enter max-age=300, cacheid=URL,

content=ESI1.0.

8. Click Apply, then save and restart WebSphere Application Server.

The WebSphere Application Server installation includes several JSP, Java servlets, and EJB examples. This section explains how to configure Oracle Web Cache to cache the following content: ■ Section 12.2.1, WebSphere Snoop Servlet ■ Section 12.2.2, WebSphere Calendar Creator JSP

12.2.1 WebSphere Snoop Servlet

The snoop servlet shows getting and using request information, headers, and parameters sent by the browser. Use it to demonstrate how Oracle Web Cache caches full-page dynamic content. To cache the snoop servlet: 1. Ensure that Oracle Web Cache has been configured to communicate with the WebSphere Application Server, as described in Section 12.1.1 . 2. Start the WebSphere Application Server, and then access the following URL: http:hostnamesnoop Notice that request information, headers, and parameters sent by your browser display. 3. Create a caching rule for the snoop output, as described in Section 6.8 . When creating the caching rule for the snoop output, ensure you configure the following in the Create Caching Rule page: ■ Click the Cache check box. ■ In the Match URL By section, select Path Prefix and enter snoop. ■ In the HTTP Methods section, click GET. 4. Point the browser to Oracle Web Cache with following URL: http:web_cache_hostname:admin_portsnoop See Section 2.11.1.1 to determine the port. The output is the same when you accessed snoop directly from the WebSphere Application Server. This time, Oracle Web Cache caches the snoop output and serves the response to the browser. 12-4 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache 5. View the contents of the cache, as described in Section 8.6 , to ensure that snoop is cached. When you reload the page, you should notice that the cached response appears faster than when you access the WebSphere Application Server directly.

12.2.2 WebSphere Calendar Creator JSP

The Calendar JSP generates a calendar based on user input. The example is not a pre-deployed WebSphere example like the snoop servlet. To find this example, install Technology Samples, as mentioned in the documentation under IBM WebSphere Application Server samples gallery. Use this JSP to demonstrate how Oracle Web Cache caches pages with session cookies. To cache SimpleTag.jsp for session-encoded URLs: 1. Start the WebSphere Application Server, set the browser to accept cookies, and then access the following URL: http:hostnameTechnologySamplesCalendar Notice that the page displays a form asking for inputs on month, year, and other preferences to create a calendar. To use the application:

a. Enter some values, and then click Continue.

b. Enter some values in the Day and Memo fields, and then click Add Memo.

c. Click Generate Calendar.

2. Create an expiration rule, as described in

Section 6.7 . In the Create Expiration Policy dialog box, perform the following steps:

a. In the Objects Expire section, select After Cache Entry and enter 60 seconds

in the Time Limit field. b. In the Action On Expired Objects section, select Remove Immediately. 3. 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 IBMSession. In the Cookie Name field, enter JSESSIONID. 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 IBMSession: In the Cache column for the first IBMSession policy, select the With Session option. In the Cache column for the second IBMSession policy, select the Without Session option. Do not select the Substitute Default Value check box. c. Create a new caching rule for Calendar. When creating the caching rule for the Calendar output, configure the following in the General tab of the Create Caching Rule page: