Caching for Objects with Embedded URL and POST Body Parameters

6-10 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache 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. By configuring session value substitution in combination with ignoring the value of embedded URL parameters, you can configure Oracle Web Cache to cache one object for multiple sessions, even if the session parameter values in session-encoded URLs vary. Continuing with the example from Section 6.5.2 , assume that Jane Doe and John Doe are again assigned an embedded URL parameters of session_ID=33436 and session_ID=33437 by the origin server. The page shown in Figure 6–2 has several A HREF=... links that include the session_ID parameter. The Oracle Database Standard Edition link under the Oracle Database heading for Jane Doe uses the following HTML code: A HREF=http:oraclestore.oracle.comOA_ HTMLibeCCtpSctDspRte.jsp?section=10166session_ID=334326Oracle Database Standard EditionA The same link for John Doe uses the following HTML code: A HREF=http:oraclestore.oracle.comOA_ HTMLibeCCtpSctDspRte.jsp?section=10166session_ID=334327Oracle Database Standard EditionA By using the value of the session_ID embedded URL parameter, Oracle Web Cache substitutes the correct session information for Jane Doe and John Doe. Figure 6–2 Session-Encoded URLs After the cache is populated with a page that contains session-encoded URLs, other requests for the page are served from the cache, regardless of whether the request has Note: Oracle Web Cache does not cache the Set-Cookie response header field. Caching and Compressing Content 6-11 a session cookie, embedded URL parameter, or POST body parameter. If the request does not contain a session cookie or embedded URL parameter, you can configure Oracle Web Cache to substitute the session information in the session-encoded URLs with a configurable default string. For configuration details, see Section 6.8.7 .

6.6 Basic Tasks for Configuring and Monitoring Caching Rules

The following provides a summary of the steps required to cache and monitor objects: 1. Configure expiration policies. See Section 6.7 . 2. Create sites for which Oracle Web Cache manages requests. See Section 2.11.3 and Section 2.11.4 . 3. Configure general settings for a caching rule. See Section 6.8.1 . 4. Configure advanced settings for a caching rule: ■ Configure cookie and HTTP request-header fields for rules supporting multiple-version objects. Section 6.8.2 . ■ Configure Oracle Web Cache to ignore the value of embedded URL or POST body parameters. See Section 6.8.3 . ■ Configure error responses for rules. See Section 6.8.5 . ■ Configure session settings for rules. See Section 6.8.6 . ■ Configure support for session-encoded URLs. See Section 6.8.7 . 5. Restart Oracle Web Cache to apply caching rule. See Section 2.13 . 6. Monitor statistics for caching rules. See Section 6.9 . 7. View popular requests. See Section 8.2 .

6.7 Configuring Expiration Policies

Prior to creating a caching rule, you create expiration policies. Later, when you create caching rules, you specify an expiration policy to apply with the caching rule. You can create expiration policies that specify when to expire objects in the cache. In addition, you can specify how long objects can reside in the cache after they have expired. When an object expires, Oracle Web Cache removes it either immediately or as permitted by origin server capacity up to a maximum time limit. To create an expiration policy: 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 Expiration.

The Expiration Policies page displays.

3. Click Create.

The Create Expiration Policy dialog displays.

4. In the Objects Expire section, specify when to expire objects by selecting an

option: ■ As per HTTP Expires Header: Select this option to respect the HTTP Cache-Control or Expires response-header fields. This is the default.