ESI Features Introduction to ESI for Partial Page Caching

11-8 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache 11.1.3 About the Surrogate-Control Response Header and Surrogate-Capability Request Header for Cached Objects To enable Oracle Web Cache to process ESI tags, you set an HTTP Surrogate-Control response-header field in the HTTP response message of the pages that use ESI tags. Surrogate-Control: content=ESI-INV1.0 ORAESI9.0.4 For each requested object from the cache, Oracle Web Cache appends a Surrogate-Capability request-header field to an objects HTTP request message. The Surrogate-Capability request-header serves the following purposes: ■ Enables applications to detect Oracle Web Cache ■ Identifies the types of ESI operations that Oracle Web Cache can perform The Surrogate-Capability request-header enables Oracle Web Cache to identify the operations it can perform to origin servers acting as caches. The Surrogate-Capability request-header field supports the following syntax: Surrogate-Capability: orcl=operation_value operation_value ... where operation_value is one or more of the following: ■ 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 The values ORAESI9.0.2, ESI1.0, and ESI-Inline1.0 are subsets of ORAESI9.0.4. For this release, you specify only ORAESI9.0.4 for ESI assembly, ESI-INV1.0 for inline invalidation, or webcache1.0 for personalized attributes. See Table 11–3 or further information about the ESI tags supported for each operation_value .

11.1.4 Syntax Rules

ESI elements and attributes adhere to XML syntax but can be embedded in other objects, such as HTML or XML objects. When Oracle Web Cache processes the page, the ESI elements themselves are stripped from the output. ESI syntax generally adheres to XML syntax rules. Keep the following in mind when using the tags: ■ ESI tags and attributes are case sensitive. They are generally lowercase. Caching Dynamic Content with ESI Language Tags 11-9 ■ Supported CGI environment variables are case sensitive. They are generally uppercase. ■ ESI does not support the use of whitespace next to the equal sign = or between the and esi: The following shows an invalid construction: esi:include src = www.foo.com The following shows the correct form: esi:include src=www.foo.com

11.1.5 Nesting Elements

As shown in Example 11–3 , an ESI tag can contain nested ESI elements and other HTML markup. Example 11–3 Nested ESI Elements esi:choose esi:when test=HTTP_HOST == www.company.com esi:include src=company.html h4Anotherh4 esi:include src=another.html esi:when esi:when test=HTTP_COOKIE{fragment == First Fragment esi:try esi:attempt esi:include src=fragment1.html esi:attempt esi:except esi:choose esi:when test=HTTP_COOKIE{otherchoice} == image img src=imgTheImage.gif esi:when esi:otherwise The fragment is unavailable. esi:otherwise esi:choose esi:except esi:try esi:when esi:otherwise The default selection. esi:otherwise esi:choose

11.1.6 Variable Expressions

ESI supports the HTTP request variables and environment variables used with the esi:environment tag. This section contains the following topics: ■ Section 11.1.6.1, Variable Usage ■ Section 11.1.6.2, Variable Default Values ■ Section 11.1.6.3, HTTP Request Variables