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*

The functionality is very similar to the request-header match. The response header match has three parameters:

  • operationdescribes 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:

    • statusmatches on the response status code.

    • name-presentchecks whether the given header name is present in the request.

    • name-value-cmpchecks whether the contents of the given header matches the given value case sensitively.

    • name-value-casecmpis the same as name-value-cmpexcept it's case insensitive.

    • name-value-strstrchecks whether the contents of the given header contains the given substring case sensitively.

    • name-value-strcasestris the same as name-value-strstrexcept 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 1contains 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-rangematch tag.

  • argument 2contains 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, the comparison won't be executed. The value supplied by the user in argument 2is 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).


The following example would require revalidation of any object that contained the HTTP header Custom-Identifierwith 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">