Exception to Order-Based Rule Precedence

Applies To:
HTTP Large
HTTP Small
ADN
HTTP Rules Engine

When dealing with multiple rules, the rule of thumb is that the order in which rules are listed determines the order in which features will be applied for each asset request. However, as previously mentioned, there is an exception to this order-based rule precedence. This exception comes into play when you have multiple rules with the same top-level matching criteria. This is illustrated with pseudo-code in the following example.

Note: The following pseudo-code is only provided to illustrate an exception to order-based rule precedence. This type of code cannot be used to configure HTTP Rules Engine.

In this example, the letters a, b, and c represent match criteria. The curly brackets indicate what will happen if the specified match criteria is met.

Rule #1:

IF (a) {

AND IF (b) {

Feature set #1

}

ELSE IF (c) {

Feature set #2

}

}

Rule #2:

IF (a) {

Feature set #3

}

You will notice that both rules contain the same top-level matching criteria (a). As a result, the features associated with the IF (a) statements will be combined. The resulting processing order can be viewed in the following pseudo-code example.

IF (a) {

Feature set #3

AND IF (b) {

Feature set #1

}

ELSE IF (c) {

Feature set #2

}

}

This type of configuration allows the possibility for the features associated with rule #2 to be overridden by the features associated with rule #1. If rule #2 had a different match criteria, then the reverse would be true.