ESI try | attempt | except Tags

Caching Dynamic Content with ESI Language Tags 11-49 value=cn=public,cn=users,dc=us,dc=oracle,dc=com esi:request_header name=PORTAL-USER-GUID value=A5EE55B396E22651E0340800208A8B00 esi:request_header name=Content-Type value=applicationx-www-form-urlencoded esi:include esi:attempt esi:except type=incompatiblefragmentversion This happens when a fragments processing requirement is not supported or not compatible with the template. esi:except esi:except type=noconnection The cache is unable to connect to the origin server serving this fragment. esi:except esi:except type=nestingtoodeep The fragment include depth has exceeded the maximum include depth. The default value defined in Web Cache is 3. esi:except esi:except type=httpservererror The origin server returns an HTTP 5xx status code, a server error. esi:except esi:except type=httpclienterror The origin server returns an HTTP 4xx status code, a client error, such as a malformed HTTP request or an unauthorized access. esi:except esi:except type=incorrectresponseheader This happens when the response headers for a fragment cause the error. esi:except esi:except type=incorrectxmlfragment This happens when there is any kind of error in Oracle Web Cache XSLT retrieval, parsing, or processing. esi:except esi:except type=originserverbusy The origin server for this fragment is busy and cannot accept new requests now. This is caused by Oracle Web Cache-to-origin server request queue limit. esi:except esi:except type=networktimeout This is thrown by a fragment whose request to the origin server has timed out in the network connection. esi:except esi:except type=incorrectesifragment An error is encountered when Oracle Web Cache tries to parse or process the ESI fragment response body due to errors in the body. esi:except esi:except Unknown ESI Exception esi:except esi:try

11.4.9 ESI vars Tag

The esi:vars tag enables you to use variables outside of ESI tags. For example, instead of specifying a variable inside a esi:include or esi:choose block, you can use the esi:vars tag to specify a variable inside HTML code.

11.4.9.1 Syntax

esi:varsOptional HTML code VARIABLE_NAME{key} Optional HTML codeesi:vars 11-50 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache

11.4.9.2 Syntax Usage

■ If the variable does not use the complete VARIABLE_NAME{key} format, Oracle Web Cache reports the following error message to the event log: [Date] [error 12086] [ecid: request_id, serial_number] ESI syntax error. Unrecognized keyword keyword is at line line. ■ Do not nest the esi:vars tag within an HTML code line. The following is an example of incorrect syntax: HTML code esi:varsVARIABLE_NAME{key}esi:varsHTML code For example, the following is invalid: IMG SRC=http:www.example.comesi:varsHTTP_ COOKIE{type}esi:varshello.gif

11.4.9.3 Usage

Section 11.1.6 and Section 11.4.3 for usage of HTTP request variables and custom variables

11.4.9.4 Example

The following ESI markup includes the cookie type and its value as part of the included URL: esi:vars IMG SRC=http:www.example.comHTTP_COOKIE{type}hello.gif esi:vars The following ESI output refers to logindata as part of the A HREF=... link for the Welcome page. logindata refers to an XML file that contains custom environment variables. The output also includes the users sessionID and category type cookie values as part of the other A HREF=... links. esi:vars A HREF=welcome.jsp?name=logindata{name} A HREF=shopping.jsp?sessionID=QUERY_STRING{sessionID}type=QUERY_ STRING{type} IMG SRC=imgshopping.gif A A HREF=news.jsp?sessionID=QUERY_STRING{sessionID}type=QUERY_ STRING{type} IMG SRC=imgnews.gif A A HREF=sports.jsp?sessionID=QUERY_STRING{sessionID}type=QUERY_ STRING{type} IMG SRC=imgsports.gif A A HREF=fun.jsp?sessionID=QUERY_STRING{sessionID}type=QUERY_ STRING{type} IMG SRC=imgfun.gif A A HREF=about.jsp?sessionID=QUERY_STRING{sessionID}type=QUERY_ STRING{type} IMG SRC=imgabout.gif A esi:vars Caching Dynamic Content with ESI Language Tags 11-51

11.4.10 ESI --esi--Tag

The --esi...--- tag enables HTML marked up with ESI tags to display to the browser without processing the ESI tags. When a page is processed with this tag, Oracle Web Cache removes the starting --esi and ending -- elements, while still processing the contents of the page. When the markup cannot be processed, this tag assures that the ESI markup does not interfere with the final HTML output.

11.4.10.1 Syntax

--esi ESI elements --

11.4.10.2 Usage

Any ESI or HTML elements can be included within this tag, except other --esi...-- tags.

11.4.10.3 Example

In the following ESI markup, the --esi and -- are removed in the final output. The output displays the content generated by pesi:varsHello, HTTP_COOKIE{name}esi:varsp, plus any surrounding text. --esi pesi:varsHello, HTTP_COOKIE{name}esi:varsp -- If the ESI markup cannot be processed, then the pesi:varsHello, HTTP_ COOKIE{name}esi:varsp is displayed in the HTML output. 11-52 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache