Syntax Rules Introduction to ESI for Partial Page Caching

Caching Dynamic Content with ESI Language Tags 11-11

11.1.6.3 HTTP Request Variables

Table 11–3 on page 11-11 lists the HTTP request variables supported by ESI. Note the following: ■ Except for QUERY_STRING, the values for the variables are taken from HTTP request-header fields. In the case of QUERY_STRING, the value is taken from either the HTTP request body or the URL. ■ Variables are only interpreted when enclosed within ESI tags. ■ Variables with a substructure type of List or Dictionary are accessed by a key. ■ Variables identified with a substructure type of Dictionary make access to strings available through their appropriate keys. ■ Dictionary keys are case sensitive. ■ Variables identified with a substructure type of List return a Boolean value depending on whether the requested value is present. Table 11–3 HTTP Request Variables Supported by ESI Variable Name HTTP Header Field Substructure TypeVariable Type Description Example HTTP_ACCEPT_ LANGUAGE{language} Accept-Language request-header field Specifies the set of languages that are preferred as a response. The language is used as the key. ListBoolean Specifies the language to use as the key and evaluates to the language specified in the HTTP request header Variable Setting: HTTP_LANGUAGE{en-gb} HTTP Request Header Contains: Accept_Language:en-gb Result: Returns en-gb. HTTP_ COOKIE{cookie} Set-Cookie response-header field or Cookie request-header field Specifies cookie name and value pairs. A cookie name is used as the key. If the Cookie request-header and Set-Cookie response-header have different values for the same cookie name, the name value pair from the Set-Cookie response header is used. Dictionary String Specifies the cookie name to use as the key and returns that cookies value Variable Setting: HTTP_COOKIE{visits} HTTP Request Header Contains: Cookie:visits=42 Result: Returns 42. HTTP_ HEADER{header} Any HTTP request header Dictionary String Specifies an HTTP request header name to use as the key and returns that headers value Variable Setting: HTTP_HEADER{Referer} HTTP Request Header Contains: Referer: http:www.company.com: 80 Result: Returns http:www.company.com: 80 11-12 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache HTTP_HOST Host request-header field Specifies the host name and port number of the resource. Port 80 is the default port number. Not Applicable String Returns the value of the HOST header Variable Setting: HTTP_HOST HTTP Request Header Contains: Host:http:www.company .com:80 Result: Returns http:www.company.com: 80 HTTP_REFERER Referer request-header field Specifies the URL of the reference resource Not Applicable String Returns the value of the REFERER header Variable Setting: HTTP_REFERER HTTP Request Header Contains: Referer: http:www.company.com: 80 Result: Returns http:www.company.com: 80 HTTP_USER_ AGENT{browser} HTTP_USER_ AGENT{version} HTTP_USER_ AGENT{os} User-Agent request-header field Specifies the Web browser type, browser version, or operating system that initiated the request. Dictionary String Specifies one of three keys: browser for browser type, version for browser version, and os for operating system Variable Setting: HTTP_USER_ AGENT{browser} HTTP Request Header Contains: User-Agent:Mozilla4.0 compatible, MSIE 5.5, Windows Result: Returns MSIE HTTP_USER_ AGENT{version} Result: Returns 4.0. HTTP_USER_AGENT{os} Result: Returns Windows QUERY_ STRING{parameter} Not Applicable Dictionary String Given a parameter name in a query string, returns the value of the parameter without URL encoding. The query string can be in an URL or a request body. See Also: http:www.rfc- editor.org for further information about URL encoding. Variable Setting: QUERY_STRING{CEO} Query Request Contains: CEO=Jane20DoeCFO=John 20Doe Result: Returns the value of fullname decoded. In this example, CEO returns a value of Jane Doe. Table 11–3 Cont. HTTP Request Variables Supported by ESI Variable Name HTTP Header Field Substructure TypeVariable Type Description Example