Rules are used to configure the CDN behavior. They can be used to influence things like origin selection, cache configuration, and access control.
Rules may be configured at the host or path level. Create a path rule to apply custom rules to a specific portion of your content. For example, you might want to apply special rules to popular content or manifests. When the CDN receives a request for content located in a particular path, any rules configured for the path are applied, according to rule order.
Path Inheritance
A path either inherits or overrides the configurations of the parent host.
When a path match occurs, any distinct rules configured for the host are inherited by the path.
For example, if a Cache Time to Live rule is defined at the host level, and a Compression rule is defined at the path level, then both rules are applied to the path.
If the same rule is defined at both the host and path level, the rule configuration at the path level overrides the configuration inherited from the host. For example, if a Cache Time to Live rule is defined at both the host and the path level, then the Cache Time to Live rule configured for the path overrides the host Cache Time to Live rule.
Some rules are applied during a specific stage of the overall transaction. We categorize these as "processing stages" rules.
The inheritance logic for Processing Stage Rules considers them as a single entity. Therefore, if any Processing Stage rule is configured at the path level, it overrides all processing stage rules configured at the host level.
For example, if the host configuration defines Origin Selection (modifies the client request) and Modify Client Response rules, and the path configuration defines a Modify Origin Request rule, then only the Modify Origin Request rule is applied to the path.
While you can add or modify a rule at any time, if your site is already published, you'll have to save the site configuration and publish it to activate the change in production.