ESA rules let you define conditions that control when specific feature configurations take effect.
Use rules to apply configurations for specific needs such as request transformation, content redirection, or cache policies. Rules also support fine-grained security and traffic management. All rules share consistent syntax to filter requests by characteristics and apply the matching configuration.
Simple configuration examples
Redirect requests by region
Rule configuration structure
When a request reaches an ESA node, ESA filters and processes it based on your rule configuration.
Every ESA rule configuration includes two parts:
Rule configuration = Rule expression + Action
Configure a rule expression to filter requests and an action to run on matched requests. The expression syntax is consistent across all rule-related features in ESA, so you can reuse configurations across features. Rule expression structure.
Rule Precedence
-
Rule configurations take precedence over global settings: For the same feature, rule settings override global settings. Apply general configurations globally and use rules to customize behavior for specific requests.
For example, if you set Edge TTL to 12 hours in Global Configuration – Edge Cache TTL and set the TTL for
/contentresources to 30 days in Rules – Configure Edge Cache TTL, the edge node caches/contentresources for 30 days. Resources not under/contentuse the 12-hour global TTL. -
Rules higher in the list have higher priority: For the same rule type, ESA executes rules from top to bottom. If a request matches multiple rules, drag the
button to reorder rules by priority.NoteAvailable features and rule quotas vary by plan. Rule and plan quotas.
For example, suppose you have two cache rules:
Rule 1: Resources under the
/contentpath expire after 30 days.Rule 2: Files with the
.jpgsuffix are cached for 60 days.-
When Rule 1 is above Rule 2:

Edge node cache TTLs:
Sample URL
Under
/contentpath.jpgsuffixCache expiration time
https://example.com/content/static/pic.jpg


30 days
https://example.com/content/static/book.txt

×
30 days
https://example.com/static/pic.jpg
×

60 days
https://example.com/static/res/book.text
×
×
Do not cache
-
When Rule 2 is above Rule 1:

Edge node cache TTLs:
Sample URI
Under
/contentpath.jpgsuffixCache expiration time
https://example.com/content/static/pic.jpg


60 days
https://example.com/content/static/book.txt

×
30 days
https://example.com/static/pic.jpg
×

60 days
https://example.com/static/res/book.text
×
×
Do not cache
-
Feature availability by plan
Feature category | Detailed feature | Entrance (0 USD/month) | Pro (15 USD/month) | Premium (249 USD/month) | Enterprise (contact sales for custom pricing) |
Number of nested sub-conditions in rules | 10 | 10 | 20 | 20 | |
Operator - Regular expression | |||||
SSL/TLS rules, HTTPS rules (shared quota) | 10 | 25 | 50 | 125 | |
5 | 25 | 50 | 125 | ||
Rewrite URL, Modify outbound request headers, Modify outbound response headers | 10 | 25 | 50 | 125 | |
URL redirection | 10 | 25 | 50 | 125 | |
Cache eligibility, Browser cache TTL, Edge cache TTL, Status code cache TTL, Custom cache key | 10 | 25 | 50 | 125 | |
10 | 25 | 50 | 100 | ||
File compression, Image optimization, Video processing (shared quota) | 10 | 25 | 50 | 100 | |
Number of rules | 10 | 25 | 50 | 125 | |



