Introduction to Creating Caching Rules

6-6 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache Figure 6–1 Multiple-Version Object You can configure Oracle Web Cache to recognize and cache multiple-version pages by using the: ■ Values of the cookie for the page ■ HTTP request headers for the page For those objects that use a cookie sometimes referred to as a category cookie , configure caching rules that specify the cookie name and whether to cache versions of the object that do not use the cookie. When a client sends an initial request for a multiple-version object, Oracle Web Cache passes the request to the origin server. In its response, the origin server includes a Set-Cookie response-header with the category cookie and its value: Set-Cookie:cookie=value Oracle Web Cache does not cache this initial response. Upon receiving the Set-Cookie response-header field, the client stores the cookie in memory. With its Caching and Compressing Content 6-7 next request to the same origin server, the client includes the Cookie request-header field with the category cookie name and value that was received in the last response: Cookie:cookie=value Oracle Web Cache still forwards the request to the origin server, which responds with or without the Set-Cookie header. Oracle Web Cache then evaluates whether the cookie and its value set in the Set-Cookie response-header matches the cookie and its value set in the Cookie request-header. If the cookie and value match, then the response is cached. Oracle Web Cache consider the absence of the Set-Cookie header a match. If cookie and its value do not match, then the response is not cached. After versions of the object are cached, Oracle Web Cache uses the value of the cookie in the clients request to serve the appropriate version of the object to the client browser. Table 6–2 shows four different versions of same URL, http:www.dot.compage1.htm. The URL uses a cookie named user_type, which supports client requests that contain cookie values of Customer, Internal, and Promotional. You can configure Oracle Web Cache to recognize the user_type cookie, enabling Oracle Web Cache to cache three different objects. In addition, you can configure Oracle Web Cache to cache a fourth object for those requests that do not use a cookie. For those objects that have different versions based on HTTP request headers, configure caching rules that specify the HTTP request header. HTTP request headers enable clients to pass additional information about the request and about themselves. Oracle Web Cache uses the header to serve the appropriate version of the URL to clients. Oracle Web Cache supports all valid HTTP request headers. Table 6–3 lists the HTTP request-header fields supported by Fusion Middleware Control. You can specify any of the standard or other HTTP request-header fields with the Surrogate-Control response-header field. Note: Oracle Web Cache does not cache the Set-Cookie response header field. Table 6–2 Multiple-Version Object with Different Cookie Values Version URL Cookie NameValue 1 http:www.dot.compage1.htm user_type=Customer 2 http:www.dot.compage1.htm user_type=Internal 3 http:www.dot.compage1.htm user_type=Promotional 4 http:www.dot.compage1.htm No cookie Table 6–3 HTTP Request-Header Field Header Field Description Accept Specifies which media types are acceptable for the response Example: Accept: imagegif, imagex-xbitmap, imagejpeg, imagepjpeg, imagepng, Accept-Charset Specifies which character sets are acceptable for the response Example: Accept-Charset: iso-8859-1,,utf-8