• No results found

Invalidation Request Syntax

In document Oracle Fusion Middleware (Page 162-166)

6 Caching and Compressing Content

HTTP Methods

7 Invalidating Content

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

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.com/webcache/90400/WCSinvalidation.dtd"

The root element INVALIDATION contains one or more of the attributes and elements described in Table 7–1.

Table 7–1 INVALIDATION Elements and Attributes Invalidation

Element/Attribute Description

VERSION attribute Required attribute in the INVALIDATION element

Denote the version of the WCSinvalidation.dtd file to use as the XML document type.

For versions 9.0.x and later, always use VERSION="WCS-1.1", unless you require previous existing applications to remain unchanged. For these applications, you can use VERSION="WCS-1.0", but the new invalidation functionality is not available.

SYSTEM element Optional element in the INVALIDATION element. The SYSTEM element requires the SYSTEMINFO element.

SYSTEMINFO element Required element in the SYSTEM element The possible NAME/VALUE pairs are:

NAME="WCS_PROPAGATE" VALUE="TRUE|FALSE"

This pair specifies whether invalidation requests are propagated to cache cluster members. If WCS_PROPAGATE is TRUE, it overrides the setting for invalidation propagation in the configuration. If WCS_PROPAGATE is FALSE, it uses the setting specified in the configuration.

The default is FALSE.

NAME="WCS_DISCONNECTED_MODE_OK" VALUE="TRUE|FALSE"

This pair specifies how soon invalidation takes place. If WCS_DISCONNECTED_

MODE_OK is TRUE, invalidation is not immediately performed. The invalidation response is sent as soon as the invalidation request is received. Set this element to TRUE, if you do not want to wait for the invalidation result. If WCS_

DISCONNECTED_MODE_OK is FALSE, invalidation is completed immediately and the invalidation result is sent.

The default is FALSE.

OBJECT element Required element in the invalidation request. You can specify multiple OBJECT elements in the request.

BASICSELECTOR element URI attribute: Required attribute of the BASICSELECTOR element. Specify the URL of the objects to be invalidated. Use these formats:

http://host_name:port/path/filename

https://host_name:port/path/filename

host_name:port is not required if the administrator account is sending the request.

ADVANCEDSELECTOR element

URIPREFIX attribute: Required attribute of the ADVANCEDSELECTOR element.

Specify the path prefix of the objects to be invalidated. The path prefix must begin with http|https://host_name:port/path/filename or "/" and end with "/".

host_name:port is required if the HOST attribute is not specified and the invalidator account is sending the request.

The prefix is interpreted literally, including reserved regular expression characters.

These characters include periods (.), question marks (?), asterisks (*), brackets ([]), curly braces ({}), carets (^), dollar signs ($), and backslashes (\).

URIEXP attribute: Optional attribute of the ADVANCEDSELECTOR element. Specify the URL of the objects to be invalidated underneath the URIPREFIX. If no value is entered, everything under the URIPREFIX are matched.

Regular expression characters are permitted. To interpret these characters literally, escape them with a backslash (\).

See http://www.cs.utah.edu/dept/old/texinfo/regex/regex_toc.html for regular expression syntax.

Notes:

The request URL that client browsers send to Oracle Web Cache and the URL that Oracle Web Cache uses internally for that request are different. When Oracle Web Cache serves a page request, it alphabetically sorts any embedded URL parameters of the URL. However, the invalidation requests are matched against only the internal representation of the URL in which any embedded URL parameters are sorted. To ensure invalidation requests are matched correctly, sort and enter the embedded URL parameters alphabetically.

When the invalidation request is sent, Oracle Web Cache performs a regular expression match of URIEXP. This can take processing time. As an alternative, you can use the OTHER element to specify a substring match rather than a regular expression match.

HOST attribute: This attribute is required if the URIPREFIX value does not include host_name:port and the invalidator account is sending the request. Specify the host name and port number of the site (host_name:port). Port 80 is the default port for HTTP.

METHOD attribute: Optional attribute of the ADVANCEDSELECTOR element. Specify either GET or POST for the HTTP request method of the objects to be invalidated. GET is the default value.

BODYEXP attribute: Optional attribute of the ADVANCEDSELECTOR element. If the METHOD is set POST, specify the HTTP POST body of the objects to be invalidated.

Note: When the invalidation request is sent, Oracle Web Cache performs a regular expression match of BODYEXP. This can take processing time. As an alternative, you can use the OTHER element to specify a substring match rather than a regular expression match.

COOKIE element Optional element in the invalidation request. Use the following attributes:

NAME attribute: Required attribute for the COOKIE element attribute. Specify the cookie name to invalidate multiple-version objects based on the cookie.

VALUE attribute: Optional attribute for the COOKIE element. Specify the value of the cookie. If no value is present, only objects with the named cookie but without a value are invalidated.

If you specify a cookie that was mistakenly specified for both a multiple-version object and a session caching policy, invalidation is based on any occurrence of the cookie. To avoid excessive invalidation, configure distinct cookies for

multiple-version objects and session caching policies.

For more information, see:

Section 6.8.2 to create caching rules for multiple-version objects

Section 6.8.6 to specify session caching policies Table 7–1 (Cont.) INVALIDATION Elements and Attributes

Invalidation

Element/Attribute Description

HEADER element Optional element in the invalidation request. Use the following attributes:

NAME attribute: Required attribute for the HEADER element. Specify the HTTP request header to invalidate multiple-version objects based on the request header.

VALUE attribute: Optional attribute for the HEADER element. Specify the value of the header.

See Section 6.8.2 to create caching rules for multiple-version objects.

OTHER element Optional element in the invalidation request. Use the following attributes:

NAME attribute: Required attribute of the OTHER element. NAME supports the following values:

- URI to specify a match of the URL underneath the URIPREFIX - BODY to specify a match of the HTTP POST body

- QUERYSTRING_PARAMETER to specify a match of an embedded URL parameter - SEARCHKEY to specify a match of a search key in the Surrogate-Key response header

TYPE attribute: Required attribute for URI, BODY, and QUERYSTRING_

PARAMETER. This attribute is not recognized for SEARCHKEY. TYPE supports the following values:

- SUBSTRING to specify an exact string match for QUERYSTRING_PARAMETER and a substring match for URI and BODY.

- REGEX to specify a regular expression match

VALUE attribute: Required attribute for URI, BODY, QUERYSTRING_PARAMETER, and SEARCHKEY. Specify the value of URI, BODY, QUERYSTRING_PARAMETER, or SEARCHKEY. If you specify a TYPE of REGEX, then escape regular expression characters with a backslash (\) for Oracle Web Cache to interpret literally.

For more information, see:

Section 7.5.5 to optimize advanced invalidations

Section 7.9 to configure search keys ACTION element Required element in the invalidation request

REMOVALTTL attribute

Optional attribute of the ACTION element. Specify the maximum time that objects can reside in the cache before they are invalidated. The default is 0 seconds.

INFO element Optional element in the invalidation request VALUE attribute

Required attribute of the INFO element. Specify a comment to be included in the invalidation result. After the invalidation request is complete, the message that contains the comment, along with the result of the invalidation, writes to the event log:

[15/Oct/2008:19:26:46 +0000] [notification 11748] [invalidation] [ecid:

21085932167,0] Invalidation with INFO 'INFO_comment' has returned with status 'status'; number of objects invalidated: 'number'.

Note: The following special XML characters must be escaped in the fields: ampersand (&) with "&amp;", greater than sign (>) with "&gt", less than sign (<) with "&lt", double quotes (") with "&quot", and single quotes (') with "&apos;".

Table 7–1 (Cont.) INVALIDATION Elements and Attributes Invalidation

Element/Attribute Description

In document Oracle Fusion Middleware (Page 162-166)