Select a site, and then click ShowEdit Selected.

Caching and Compressing Content 6-19 The following webcache.xml fragment shows the User-Agent remapping: USERAGENTREMAPRULE MATCHSTRING=MSIE MAPPEDUSERAGENT=MSIE MAPTYPE=USERAGENT USERAGENTREMAPRULE MATCHSTRING=Mozilla MAPPEDUSERAGENT=MOZ MAPTYPE=USERAGENT If an incoming request does not match any of the rules, Oracle Web Cache appends a default mapping to the request. The default value of the x-Oracle-Mapped-User-Agent header is DEFAULT_USER_AGENT. These mapping rules are executed for every incoming request. If you create several mapping rules, you may experience a performance degradation. 5. Locate the MULTIVERSIONHEADERSRULE subelement of CACHEABILITYRULE for the caching rule created in Step 1. MULTIVERSIONHEADERSRULE HTTPHEADER NAME=User-Agent MULTIVERSIONHEADERSRULE 6. To match on the value of the MAPPEDUSERAGENT string rather than the entire User-Agent value, change the User-Agent header to x-Oracle-Mapped-User-Agent in the HTTPHEADER attribute of the rule: MULTIVERSIONHEADERSRULE HTTPHEADER NAME=x-Oracle-Mapped-User-Agent MULTIVERSIONHEADERSRULE 7. Save webcache.xml. 8. Restart Oracle Web Cache using opmnctl. See Section 2.13.1 .

6.8.5 Configuring Error Responses for Rules

To understand how you can cache HTTP error responses to save origin server resources, see Section 6.5.3 . To create a caching rule for an error response: 1. Create a caching rule. See Section 6.8.1 .

2. 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.

3. Click the Error Responses tab.

Table 6–5 GLOBALCACHINGRULES Subelements Subelement Description MATCHSTRING Enter the pattern that used to match the incoming request header. Note: You can use the wildcard to pattern match for multiple browser type variants. For example, Mozilla can be used to match all variations of Mozilla. MAPPEDUSERAGENT Enter a unique value of the User-Agent pattern that to be added to the x-Oracle-Mapped-User-Agent request header by Oracle Web Cache. MAPTYPE Enter USERAGENT to pattern match on the User-Agent request header. 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 .