Overview of Invalidation Oracle Fusion Middleware Online Documentation Library

Invalidating Content 7-3 For instance, when a customer purchases a vegetarian cookbook on an e-commerce site, the confirmation response could contain instructions for invalidating all catalog pages related to the book, its author and vegetables. The ability to send invalidation message inline reduces the connection overhead associated with sending out-of-band invalidations and is a useful tool for ESI developers. For more information about using ESI invalidation, see Section 11.3 .

7.4 About Response Header Invalidations

Response header invalidation is Oracle Web Cache functionality that enables an origin server to return a transactional response whose response body contains something other than HTML. This is a circumstance in which ESI inline invalidation does not work; Oracle Web Cache can only use ESI invalidation tags in conjunction with a response body that contains HTML. With response header invalidation, origin servers can send invalidation directives in a proprietary invalidation response header. In addition to its greater flexibility in terms of response body content returned, response header invalidation requires less coding effort on the part of the Web applications since building an invalidation header is a fairly lightweight task. Response header invalidation functions similarly to inline invalidation; origin servers piggyback invalidation directives on responses sent to Oracle Web Cache. However, the response header invalidation enables invalidation when the response body contains something other than HTML. The origin server adds a special invalidation header to its response. Oracle Web Cache extracts the invalidation header, invalidates the corresponding content and forwards the response to its client but without the invalidation header in the response. Origin Servers can piggyback an invalidation response header on any random response. For example, an origin server may delay the sending of an invalidation directive and then send it later in a response to a request that has nothing to do with the request that caused the invalidation in the first place. Oracle Web Cache strips out the invalidation response header when returning the response to a Web client. Oracle Web Cache even strips out the invalidation response header when returning the response to another member of an cache cluster, since cluster propagation forwards the invalidation to other peers in the cluster. For more information about enabling response header invalidation, see Section 7.8 .

7.5 Format of Invalidation Requests for Out-of-Band and ESI Inline Mechanisms

The out-of-band mechanisms send out-of-band HTTP POST invalidation requests in Extensible Markup Language XML syntax. The ESI inline mechanism also uses the same syntax within the esi:invalidate tag. The contents of the XML request body instructs the cache which URLs to mark as invalid. The following sections describe invalidation request syntax: ■ Section 7.5.1, Invalidation Request Syntax ■ Section 7.5.2, Invalidation Response Syntax ■ Section 7.5.3, Invalidation Preview Request Syntax ■ Section 7.5.4, Invalidation Preview Response Syntax ■ Section 7.5.5, Invalidation Examples 7-4 Oracle Fusion Middleware Administrators Guide for Oracle Web Cache

7.5.1 Invalidation Request Syntax

Use the following syntax to invalidate objects contained within an exact URL that includes the complete path and file name: ?xml version=1.0? DOCTYPE INVALIDATION SYSTEM internal:WCSinvalidation.dtd INVALIDATION VERSION=WCS-1.1 SYSTEM SYSTEMINFO NAME=name VALUE=value SYSTEM OBJECT BASICSELECTOR URI=URL ACTION REMOVALTTL=TTL INFO VALUE=value OBJECT INVALIDATION Use the following syntax to invalidate objects based on more advanced invalidation selectors: ?xml version=1.0? DOCTYPE INVALIDATION SYSTEM internal:WCSinvalidation.dtd INVALIDATION VERSION=WCS-1.1 SYSTEM SYSTEMINFO NAME=name VALUE=value SYSTEM OBJECT ADVANCEDSELECTOR URIPREFIX=prefix URIEXP=URL_expression HOST=host_name:port METHOD=HTTP_request_method BODYEXP=HTTP_body COOKIE NAME=cookie_name VALUE=value HEADER NAME=HTTP_request_header VALUE=value OTHER NAME=URI|BODY|QUERYSTRING_PARAMETER|SEARCHKEY TYPE=SUBSTRING|REGEX VALUE=value ADVANCEDSELECTOR ACTION REMOVALTTL=TTL INFO VALUE=value OBJECT INVALIDATION The body of a valid invalidation request must begin with the following: ?xml version=1.0? DOCTYPE INVALIDATION SYSTEM internal:WCSinvalidation.dtd The first line denotes version 1.0 of XML. The second line denotes that the request is an invalidation request using the WCSinvalidation.dtd file as the XML document type. WCSinvalidation.dtd is the Document Type Definition DTD that defines the grammar of invalidation requests and responses. Note the following: ■ No white space is allowed before ?xml. ■ If an application is sharing invalidation requests with a third-party XML parser, replace internal:WCSinvalidation.dtd with the following path: http:www.oracle.comwebcache90400WCSinvalidation.dtd