Response header match
This tag matches on characteristics of the response header. It facilitates matching on MIME type and HTTP Reply Status code.
Tag synax
Consider this syntax template:
<match:response-header operation=*enum* argument1=*headername or status-code*
argument2=*string*>
</match:response-header>
The functionality is very similar to the request-header match. The response header match has three parameters:
-
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
matches 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 given value case sensitively. -
name-value-casecmp
is the same asname-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
is the same asname-value-strstr
except it's not case sensitive. -
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 exceptstatus
. Forstatus
, 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 thecpcode-range
match tag. -
argument 2
contains the value to match against for all operations exceptstatus
. For the numeric operators, only integer value s are considered. If the header's value is not numeric, the comparison won't be executed. The value supplied by the user inargument 2
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>
Updated over 3 years ago