The Page Rules drop-down list contains a variety of classified actions. One of them is “Request Limiting Action”,
The action is used to control requests. Select Limit Request Rate to control the speed of requests:
Limiting Request Rate is based on the Leaky Bucket Algorithm, relying on three parameters to control requests:
Key Word: The default option is the IP address from the terminal, and the drop-down box offers other options, i.e. URI, URI Parameter, or Cookie. Selecting URI Parameter or Cookie requires one more corresponding Argument field to be specified;
Adjust Rate: Requests with a lower rate will not encounter any restriction; requests with a rate higher than this level but lower than the Reject Rate level will experience delayed execution;
Reject Rate: Requests with a higher rate will be rejected, with 503 http status code directly returned to the terminal.
The latter two parameters have the default unit of Request Per Second, but Request Per Minute is optional.
If the two parameters have the same value, requests exceeding the set value will be rejected directly, without any delay for buffer.
Unconditional execution is the default for this action, resulting in the rate limitation of all requests on this app.
Given the rigidity of this approach, another can be adopted to exercise control under more precise conditions.
Action, conditions are classified and grouped by URI,
request, response, and terminal information.
Select Country from the terminal information, for example, Japan, the above action will be executed in the following condition only when requests come from Japan:
Here, input JP, the abbreviation for Japan. The Edge language file provides the abbreviations for all continents, countries, provinces, and cities:
With the action and condition in place, the rule setting is successful by clicking the Create button on the bottom right-hand side. The current page will then automatically jump back to the Page Rules page.