Recognizing Similar Browser Types for Multiple-Version Objects Containing HTTP Request Headers

6-20 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache 4. Select the HTTP error codes you want Oracle Web Cache to cache and serve for this rule. Ensure the origin server generates the HTTP error itself.

5. Click OK to apply changes.

6. Restart Oracle Web Cache. See Section 2.13 .

6.8.6 Configuring Session Caching Rules

To understand how Oracle Web Cache serves requests with the existence or nonexistence of session cookies, embedded URL parameters, or POST body parameters, see Section 6.5.4 . To specify how session-related pages are served by Oracle Web Cache:

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

Configuration . The Session Definitions page displays.

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

Section 2.12 . 3. Specify session policy settings:

a. In the Session Policy Configuration section, click Create.

A new row in the table appears.

b. From the Session Name list, select the session you created in Step 2.

c. In the Cache column, select the Without Session check box for Oracle Web

Cache to cache versions of objects that do not use the cookie or parameter; select No for Oracle Web Cache not to serve objects from the cache for requests without the session information.

d. In the Cache column, select the With Session check box for Oracle Web Cache

to cache versions of objects that use the cookie or parameter.

e. In the Substitute Default Value column, select the check box to instruct

Oracle Web Cache to cache one version of the object. For those requests without a cookie or parameter, a default value is used. Do not select the check box to instruct Oracle Web Cache to cache two different versions of the object. Oracle Web Cache serves one version to those requests that support the cookie or parameter and serves the other version to those requests that do not support the cookie or parameter. 4. Create a caching rule. See Section 6.8.1 . 5. Associate session policies with a caching rule:

a. From the Site-Specific Caching Rules or the Global Caching Rules section of

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

c. From the Session Definition list, select the sessions you created in Step 2 and

defined a policy for in Step 3.

d. Click OK to apply changes.

6. Restart Oracle Web Cache. See Section 2.13 . 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: