From the Site Specific Caching Rules or the Global Caching Rules section of the Click the Error Responses tab.

Caching and Compressing Content 6-21

6.8.7 Configuring Support for Session-Encoded URLs

You can configure Oracle Web Cache to substitute sessions within HTML hyperlink tags with the session values obtained from a session cookie, embedded URL parameter, or POST body parameter. To understand how Oracle Web Cache can cache one object for multiple sessions, even if the session parameter values in session-encoded URLs vary, see Section 6.5.5 . To substitute session values in session-encoded URLs:

1. Navigate to the Web Cache Home page in Fusion Middleware Control. See

Section 2.6.2 .

2. From the Web Cache menu, select Administration and then select Session

Configuration . The Session Definitions page displays.

3. Create a session definition in the Session Definitions table. See

Section 2.12 . When entering data for the Default Value field, enter a default string for the value of the embedded URL parameter. Oracle Web Cache uses the value you enter in the Default Value field for those requests without the value for an embedded URL parameter. For these requests, Oracle Web Cache substitutes the value with a default string. The string defaults to default. For example, the following A HREF=... contains a session_ID parameter without a value: A HREF=https:oraclestore.oracle.comOA_ HTMLibeCCtpSctDspRte.jsp?section=11886session_ID=Master IndexA If the string is set to default, Oracle Web Cache substitutes the value with default. A HREF=https:oraclestore.oracle.comOA_ HTMLibeCCtpSctDspRte.jsp?section=11886session_ID=defaultMaster IndexA

4. Create a caching rule. See

Section 6.8.1 .

5. From the Site Specific Caching Rules or the Global Caching Rules section of the

Caching Rules page, select the rule you created and click Edit. The Create Caching Rule page displays.

6. Click the Sessions tab.

7. Click Process for Session-Encoded URLs.

8. Click OK to apply changes.

9. Restart Oracle Web Cache. See Section 2.13 .

6.8.8 Configuring Rules for Popular Pages with Session Establishment

Some Web sites require users to have sessions while surfing most pages. To preserve the session requirement, create a session caching rule for those pages. This way, Oracle Web Cache always forwards a request without a session to the origin server. For some popular site entry pages, such as , that typically require session establishment, session establishment effectively makes the page non-cacheable to all new users without a session. To cache these pages while preserving session establishment, make the following minor modifications to your application: 6-22 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache 1. Create a blank page for the entry URL, such as , that redirects to the real entry page. 2. Configure the origin server to create a session when the blank page is requested without a session cookie. 3. Create a session caching rule for the real entry page and the blank page, as described in Section 6.8.6 , and click both the Cache With and Cache Without options. With this configuration, all initial user requests to the entry URL first go to the blank page, which requires minimal resources to generate. The clients receive the response and session establishment from the application Web server. Subsequent redirected requests to the entry page carry the session, enabling the entry page to be served out of the cache. Another solution is to use a Javascript that sets a session cookie for the pages requiring sessions: 1. Create a Javascript that sets a session cookie when one does not exist. 2. Add the Javascript to each of the pages that require the session. 3. Create caching rules for the Javascript and the session pages, as described in Section 6.8.1 and Section 6.8.6 .

6.9 Monitoring Summary Settings for Caching Rules

Fusion Middleware Control provides statistics for assessing the effectiveness of configured caching rules. To view caching-rule statistics: 1. Navigate to the Web Cache Home page in Fusion Middleware Control. See Section 2.6.2 .

2. From the Web Cache menu, select Administration and then Caching Rules.

The Caching Rules page displays. 3. Scroll to the far right to view the statistics for a caching rule: ■ Multi-Versionings: Shows whether this caching rule contains settings for requests with multiple versions. ■ Sessions: Shows whether this caching rule contains settings for requests with a cookie, embedded URL parameter, or POST body parameter with user session information. ■ Error Responses: Shows whether this caching rule contains settings for requests with HTTP error responses. ■ Matched: Displays the number of requests that matched the caching rule. See Section 8.2 to view the objects cached by Oracle Web Cache Note: Using the Javascript solution, it is not necessary to create a session caching rule for the pages requiring sessions.