HTTP Cache Validation About Cache Consistency

6-4 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache

6.4 Introduction to Creating Caching Rules

When you decide to create a caching rule for an object, determine first whether the rule for the object is for a specific site or global to all sites. Oracle Web Cache gives site-specific caching rules a higher priority than the global rules. After you determine that choice, you configure general attributes for the rule: ■ Information about the rule, such as its name, description, site, and whether or not to enable the rule ■ Actions for Oracle Web Cache to take when an incoming request matches a rule ■ Match criteria for Oracle Web Cache to locate the matching rule for incoming requests. Select to base the match evaluation on the request URL expression, the response MIME type, or both criteria. If you do not select a match criteria, Oracle Web Cache matches the rule to all URLs and all MIME types. Matching the evaluation on the MIME type makes sense when entering URL expressions becomes cumbersome. For example, the following shows a complicated URL expression for various image types: \.gif|jpe?g|png|bmp Instead, you can select the MIME Type option, select Starts with, and enter the following string in the expression field: image For most match evaluations, select the Starts with option, because the Content-Type response header typically has additional content parameter values. You can also enter a list in the expression field, separated by commas. Continuing with the same example, if you want to match only GIF or JPEG responses, enter the following string in the expression field: imagegif, imagejpeg After you create caching rules, you order the priority of caching rules. Higher priority rules are matched first. Oracle Web Cache gives site-specific caching rules a higher priority than the global caching rules. When ordering caching rules for cacheable and non-cacheable objects, give the non-cacheable objects a higher priority than the cacheable objects. In the rules shown in Table 6–1 , rule 2 caches objects of the URL that use the GET and GET with query string methods, and rule 3 caches objects of the URL that use the POST method and a POST body matching action=search. If the order were reversed, all objects starting with ceccstage?ecaction=ecpassthru would be cached, including ceccstage?ecaction=ecpassthru2.