Configuring Rules for Popular Pages with Session Establishment

Caching and Compressing Content 6-23

6.10 Using the Surrogate-Control Response Header as an Alternative to Caching Rules

In addition to, or as an alternative to, creating caching rules with Fusion Middleware Control, application developers can choose to store many of the caching attributes in the header of an HTTP response message. This feature enables the application Web server to override the settings configured through Fusion Middleware Control interface, as well as allow other third-party caches to use Oracle Web Cache caching attributes. All except the following attributes described in Section 6.8 are supported: ■ Session caching rules ■ HTTP error response caching rules To enable this feature, set the HTTP response with the Surrogate-Control response-header field as described in the following section. For a description of how Oracle Web Cache uses caching attributes from the Surrogate-Control response header and Oracle Web Cache Manager to determine cache population, see Section 6.1 .

6.10.1 Surrogate-Control Response-Header Field

The Surrogate-Control response-header field enables application developers to specify caching attributes of an object. This response-header field enables the application Web server to override the caching rules configured through administrative interfaces Fusion Middleware Control or Oracle Web Cache Manager. The Surrogate-Control response-header field supports the following syntax: Surrogate-Control:[content=content_type, content_type,..] [no-store][max-age=expiration_time[+removal_time]] [vary=headersheader header...][cookiecookie_name cookie_name...] [compress=yes|no] Table 6–6 describes the supported control directives. 6-24 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache Table 6–6 Control Directives for Surrogate-Control Control Directive Description content Specify what kind of processing is required: ■ ORAESI9.0.4 to process ESI tags with Oracle-proprietary additions for content assembly and partial page caching. ORAESI9.0.4 supports all the ESI tags provided by Oracle Web Cache in 10g 9.0.4 and later releases. ■ ORAESI9.0.2 to process ESI tags with Oracle proprietary additions for content assembly and partial page caching. ORAESI9.0.2 supports all the ESI tags provided by Oracle Web Cache in Release 2 9.0.2 and 9.0.3. ■ ESI1.0 to process standard ESI tags for content assembly and partial page caching ■ ESI-Inline1.0 to process esi:inline tags ■ ESI-INV1.0 to process esi:invalidate tags ■ webcache1.0 to process the -- WEBCACHETAG-- and -- WEBCACHEEND-- tags for personalized attributes ORAESI9.0.2, ESI1.0, and ESI-Inline1.0 are subsets of ORAESI9.0.4. In this release, you specify only ORAESI9.0.4 for ESI assembly, ESI-INV1.0 for inline invalidation, or webcache1.0 for personalized attributes. For further information about the ESI tags supported for each processing version, see Chapter 11, Caching Dynamic Content with ESI Language Tags. no-store Specify for Oracle Web Cache to not cache the object. vary Specify the HTTP request headers or cookies to instruct Oracle Web Cache to cache and identify multiple-version objects. Use the following format: vary=[headersheader[f] ;] [cookiescookie_name[f] ] Specify f to instruct Oracle Web Cache to only cache versions of the object based on the existence of the HTTP request headers or cookies. Exclude f to instruct Oracle Web Cache to cache versions of the object, regardless of whether the HTTP request headers or cookies exist. Usage notes: ■ Specify at least one HTTP header or cookie. ■ If you specify both HTTP request headers and cookies, specify the HTTP request header before the cookies. ■ Use zero or more spaces between the parentheses and semicolons. ■ When specifying multiple HTTP request headers or cookies, use one or more spaces between the HTTP request headers and cookie names. compress Specify yes for Oracle Web Cache to serve compressed cacheable and non-cacheable objects to all browser types; specify no for Oracle Web Cache to not serve compressed cacheable and non-cacheable objects to browsers. This control directive does not enable you to specify browser types. If you specify yes and must limit the browser types, specify a compression caching rule, as described in Section 6.8.1 . To understand what Oracle Web Cache automatically compressed and does not compress, see Section 1.2.5 . max-age Specify for Oracle Web Cache to cache the object. Specify the time, in seconds, to expire the object after it enters the cache. Optionally, specify the time, in seconds, to remove the object from the cache after the expiration time. Use the following format: max-age=expiration_time[+removal_time] Usage notes: ■ The default removal time is 0 seconds ■ max-age=infinity specifies that the object never expires