Response Property Matches

response-header

This match tag matches on characteristics of the response header. In specific, this tag was implemented to facilitate matching on MIME type and HTTP Reply Status code.

The syntax for the tag is:

<match:response-header operation="enum" argument1="headername or status-code" 
argument2="string">
</match:response-header>
The functionality of this match type is very similar to the request-header match type. Like the request-header match, the response header match has three properties:
  • operation: Describes the type of matching to perform. All operations, except the numeric comparisons, can be negated by prefixing them with an exclamation point “!”
    Possible values are:
    • status: Match on the response status code.
    • name-present: Checks whether the given header name is present in the request.
    • name-value-cmp: Checks whether the contents of the given header matches the give n value case sensitively.
    • name-value-casecmp: Same as name-value-cmp except it's case insensitive.
    • name-value-strstr: Checks whether the contents of the given header contains the given substring case sensitively.
    • name-value-strcasestr: Same as name-value-strstr except it's case insensitive.
    • name-value-num-ne: (numeric comparison: !=) name-value-num-lt: (numeric comparison: <) name-value-num-le: (numeric comparison: <=) name-value-num-gt: (numeric comparison: >) name-value-num-ge: (numeric comparison: >=)
  • argument 1: contains the header-name to match against for all operations except 'status'. For 'status', it has to be a status code (or list/range of codes) to match against. The range can be specified in the same syntax used by the cpcode-range match tag.
  • argument 2: contains the value to match against for all operations except 'status'. For the numeric operators, only integer value s are considered. If the header's value is not numeric, t he comparison won't be execute d. The value supplied by the user (in argument2) is on the right and the value from the response header is on the left of the operator:
    header-value (==,!=,<,<=,>,>=) user-supplied-value

The largest number that the edge server can handle in this comparison is (231 - 1) or (2147483647).

Examples:

The following example would require revalidation of any object that contained the HTTP header “Custom-Identifier” with a value of “a2f9e724”. A scheme of this nature might be useful for forcing revalidation of all files that are related. This relationship would be expressed by the value of the Custom-Identifier.

<match:response-header operation="name-value-cmp" argument1="Custom-Identifier" argument2="a2f9e724">
    <revalidate>1046581729</revalidate>
</match:response-header>