Edge Security Acceleration (ESA) lets you create rules to customize settings for incoming requests. To apply custom settings like transform, redirect, or cache to specific requests, or to gain detailed control over security and traffic management, use syntax and configuration logic to filter requests based on specific characteristics and configure the appropriate features.
Understanding rules by basic examples
Set a redirect rule to redirect certain requests
How rules work
When a request reaches the ESA POP, ESA filters the request based on your rule configuration and processes it accordingly.
An ESA rule comprises two parts:
Rule configuration = Rule expression + Action
You can configure a rule expression to filter requests and action to perform actions on matched requests. The syntax of rule expressions applies to all ESA rule configurations.
Priorities
Rule configurations have a higher priority than global settings: For the same feature, the rule takes precedence over global settings. Therefore, you can configure global settings for broad application across all requests, while also configuring rules for customized settings tailored to particular requests.
If you have set Edge Cache TTL to 12 hours and configured the edge cache TTL for the
/content
directory to 30 days, the TTL for the/content
directory is changed to 30 days accordingly. If the requested resource is not in the/content
directory, its TTL is still 12 hours.The rule at the top has the highest priority: For the same feature, the rules are executed from top to bottom. Therefore, if a request meets the trigger conditions defined in multiple rules simultaneously, promote the rule you want to prioritize by dragging
.
NoteEach plan supports different features and rules. For more information, see Select a suitable plan.
For example, if you have two cache rules:
Rule 1: The TTL of resources in the
/content
directory is 30 days.Rule 2: The TTL of files with the suffix
.jpg
is 60 days.In the following figure, Rule 1 is positioned at the top, with Rule 2 below it.
The following table lists the TTL for different resources on POPs.
Sample URI
In the
/content
directory or not.jpg
suffixTTL
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 it.
In the following figure, Rule 2 is positioned at the top, with Rule 1 below it.
The following table lists the TTL for different resources on POPs.
Sample URI
In the
/content
directory or not.jpg
suffixTTL
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 it.
Availability
Rule | Entrance | Pro | Premium | Enterprise |
Security rules | 10 | 25 | 50 | 125 |
Browser cache TTL | 2 hours | 1 hour | 1 second | 1 second |
Edge cache TTL | 2 hours | 1 hour | 1 second | 1 second |
Custom port cache | × | × | × | |
Cache reserve | × | × | × | |
Redirect rules | 10 | 25 | 50 | 125 |
Network optimization rules | 10 | 25 | 50 | 100 |
File compression rules | × | × | × | 10 |