ESI inline Tag ESI Tag Descriptions

Caching Dynamic Content with ESI Language Tags 11-47 If the attempt fails, then perform this action... esi:except esi:try In the following form, multiple esi:except tags with different types are supported: esi:try esi:attempt Try this... esi:attempt esi:except [type=type] If the attempt fails, then perform this action... esi:except esi:except [type=type] Perform this action... esi:except esi:except If the attempt fails, then perform this action... esi:except esi:try

11.4.8.2 Usage

Oracle Web Cache first processes the contents of esi:attempt. A failed esi:attempt triggers an error and causes Oracle Web Cache to process the contents of the esi:except tag. Specify an esi:except tag without a type for general errors; specify an esi:except tag with a type for specific errors. The esi:except tag accepts the following case-insensitive types: ■ nestingtoodeep: An error occurs because the fragment include depth has exceeded the maximum include depth. ■ originserverbusy: An error occurs because 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 being reached. ■ noconnection: An error occurs because the cache cannot connect to the origin server serving this fragment. ■ networktimeout: An error occurs because a fragment request to the origin server has timed out in the network connection. ■ httpclienterror: An error occurs because the origin server returns an HTTP 4xx status code, a client error, such as a malformed HTTP request or an unauthorized access. ■ httpservererror: An error occurs because the origin server returns an HTTP 5xx status code, a server error. ■ incompatiblefragmentversion: An error occurs because a fragments processing requirement is not supported or not compatible with the template. -- WEBCACHETAG-- and -- WEBCACHEEND-- processing in an ESI fragment is not compatible with ESI processing. A fragment may be plain data that does not need any processing in the cache, or it may be an ESI template itself that requires processing of ESI features supported in this release. The ESI features in use are specified by the Surrogate-Control content control directive. ■ incorrectresponseheader: An error occurs because the response headers for a fragment causes the error. 11-48 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache ■ incorrectesifragment: An error occurs when Oracle Web Cache tries to parse or process the ESI fragment response body due to errors in the body. ■ incorrectxmlfragment: An error occurs because there is an error in XSLT retrieval, parsing, or processing by Oracle Web Cache.

11.4.8.3 Example

The following ESI markup attempts to fetch an advertisement. If the advertisement cannot be included, Oracle Web Cache includes a static link instead. esi:try esi:attempt esi:comment text=Include an ad esi:include src=http:www.company.comad1.htm esi:attempt esi:except esi:comment text=Just write some HTML instead a href=www.company.comwww.company.coma esi:except esi:try The following ESI markup attempts to fetch a fragment. If the fragment cannot be included because of httpclienterror, then Oracle Web Cache includes cgi-binesi-fetch?esitryNestL1.html instead. esi:try esi:attempt esi:include src=frag.html esi:attempt esi:except type=httpclienterror esi:include src=cgi-binesi-fetch?esitryNestL1.html esi:except esi:try The following esi:try attempts to include the fragment http:server.portal.complsppcdemoPCDEMO.wwpro_app_ provider.execute_portlet51310494026 containing several HTTP request headers. If the fragment cannot be included because of various type errors, Oracle Web Cache returns an Unknown ESI Exception error. esi:try esi:attempt esi:include src=http:server.portal.complsppcdemoPCDEMO.wwpro_app_ provider.execute_portlet51310494026 timeout=15000 esi:request_header name=X-Oracle-Device.MaxDocSize value=0 esi:request_header name=Accept value=texthtml,textxml,textvnd.oracle.mobilexml esi:request_header name=User-Agent value=Mozilla4.0 compatible; MSIE 5.5; Windows; YComp 5.0.0.0 RPT-HTTPClient0.3-3 esi:request_header name=Device.Orientation value=landscape esi:request_header name=Device.Class value=pcbrowser esi:request_header name=PORTAL-SUBSCRIBER value=us esi:request_header name=Device.Secure value=false esi:request_header name=PORTAL-SUBSCRIBER-DN value=dc=us,dc=oracle,dc=com esi:request_header name=PORTAL-SUBSCRIBER-GUID value=A5EE385440E6252BE0340800208A8B00 esi:request_header name=Accept-Language value=en-us esi:request_header name=PORTAL-USER-DN