Create a new request throttling strategy
You can create a new request throttling strategy. You must:
-
Create a strategy item template
-
Implement a strategy class
-
Apply the strategy
Create a strategy item template
Create a strategy item template
To add a strategy item template:
-
Create a new template under /sitecore/templates/System/Services/Throttle, using the /System/Templates/Template template. Add fields and set the base template to /sitecore/templates/System/Services/Throttle/Strategy template.
-
To configure the insert rules, add the template you created to the list in the Masters field in the /sitecore/templates/System/Services/Throttle/Strategy Folder/__Standard Values item.
-
Add standard values for the template you created and set the default values for the fields:

Implement a strategy class
Implement a strategy class
To create a strategy class:
-
In Visual Studio, create a project, and create a strategy class that inherits from the
DataThrottleStrategybase class. -
You must implement these three methods:
-
InitCore – Put all initialization steps here (for example, binding the strategy properties to strategy item fields.)
-
VerifyCore – Put the logic that specifies whether a request is allowed or not here. You can save the internal state in the CustomData field of the ThrottleStrategyData class. An instance of this class is passed as an argument to the method.
-
CommitCore – Use this method if all the strategies allowed the request and the strategy can change its internal state if it needs to do it.
-
-
Register the new strategy by creating the class implementing
IServicesConfiguratorinterface, then patch theservicessection to add the following: -
Put the binary assembly file in the bin folder of your Sitecore instance.
The following is an example of a strategy class implementation:
Apply the strategy
Apply the strategy
To apply the strategy:
-
Create a strategy item from the strategy template you created:

Now you can apply the strategy with the methods described.