Configuring Expiration Policies Oracle Fusion Middleware Online Documentation Library

Caching and Compressing Content 6-13

a. From Site Specific Caching Rules or Global Caching Rules section, click

Create . The Create Caching Rule page displays with the General tab in view. b. Complete the elements using the descriptions in Table 6–4 . When completing the elements, in the Match Criteria section, select to base 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. If you find entering URL expressions is cumbersome for your rules, select the MIME Type option in the Match Criteria section. See Section 6.4 for further information about using the MIME Type option in place of complicated URL expressions.

c. Click OK to apply changes and return to the Caching Rules page. It is not

necessary to click Apply in the Create Caching Rule page to apply this change. Notice the caching rule is added to the Site Specific Caching Rules or Global Caching Rules table. 4. Repeat Step 3 for each additional rule.

5. Use the Move Up and Move Down icons to change the order in which the rules

are matched against requests. The order of the rules is important. Oracle Web Cache matches higher priority rules first.

6. Click Apply to apply the move change.

7. In the Caching Rules page, click Enable to enable rules.

If you do not click Enable, Oracle Web Cache ignores any the settings for the rule. 8. Restart Oracle Web Cache. See Section 2.13 . Table 6–4 Caching Rules - General Page Element Description Name Enter a string that uniquely identifies the caching rule. Description Enter a descriptive comment about the caching rule. Enabled Select to enable the caching rule; deselect to disable the caching rule temporarily without losing the rule definition. Site Displays the site for which to apply this rule. If you do not see the site required, create one, following the procedure in Section 2.11.3 . Cache Select this option to instruct Oracle Web Cache to cache content; deslect this option to instruct Oracle Web Cache to forward requests to the origin server and to not cache the content. Expiration From the list, select an expiration policy to apply to the objects. If you do not see an expiration policy suitable for the objects, click the Expiration Policies link. 6-14 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache Compress Select this option to instruct Oracle Web Cache to serve compressed cacheable and non-cacheable objects to browsers. To enable compression for this rule, you must also enable compression for the site. To set the compression property for a site, see Section 2.11.3 . Oracle Web Cache automatically disables compression for some common file types which are known to be already compressed. Oracle recommends not compressing content for these file type, including GIF, JPEG, and PNG images, or files that are already compressed with utilities like WinZip or GZIP. Compressing these files incurs additional overhead without gaining any compression benefit. See Section 1.2.5 to better understand when Oracle Web Cache automatically disables compression. Match URL By Select to base the match evaluation on the URL expression: 1. Select the expression type: - File Extension: Select to apply the caching rule to objects ending in a particular file extension, such as .gif. In the accompanying field, enter the file extension. Because Oracle Web Cache internally starts the file extension with a period ., it is not necessary to enter it. - Path Prefix: Select to apply the caching rule to objects matching a path prefix. In the accompanying field, enter the path prefix of the objects. Start the path with ; do not start the path with http:host_name:port. The prefix is interpreted literally, including reserved regular expression characters. These characters include periods ., question marks ?, asterisks , brackets [], curly braces {}, carets , dollar signs , and backslashes \. - Regular Expression: Select to apply the caching rule to objects matching regular expression syntax. In the accompanying field, enter the regular expression of the objects. Remember to use to denote the start of the URL and to denote the end of the URL. 2. Click the Case Insensitive Match check box to match requests regardless of the case. If you do not select this check box, the rule bases the match on the case. Table 6–4 Cont. Caching Rules - General Page Element Description