کتابخانه AspNetCoreRateLimit
200, OK
https://github.com/stefanprodan/AspNetCoreRateLimit icon

AspNetCoreRateLimit is an ASP.NET Core rate limiting solution designed to control the rate of requests that clients can make to a Web API or MVC app based on IP address or client ID. The AspNetCoreRateLimit package contains an IpRateLimitMiddleware and a ClientRateLimitMiddleware, with each middleware you can set multiple limits for different scenarios like allowing an IP or Client to make a maximum number of calls in a time interval like per second, 15 minutes, etc. You can define these limits to address all requests made to an API or you can scope the limits to each API URL or HTTP verb and path.

کتابخانه AspNetCoreRateLimit
کتابخانه WebApiThrottle
200, OK
https://github.com/stefanprodan/WebApiThrottle icon

ASP.NET Web API Throttling handler, OWIN middleware and filter are designed to control the rate of requests that clients can make to a Web API based on IP address, client API key and request route.

public static void Register( HttpConfiguration config )
{
    config.MessageHandlers.Add( new ThrottlingHandler
                                {
                                    Policy = new ThrottlePolicy( perSecond: 1,
                                                                    perMinute: 20,
                                                                    perHour: 200,
                                                                    perDay: 1500,
                                                                    perWeek: 3000 )
                                                {
                                                    IpThrottling = true
                                                },
                                    Repository = new CacheRepository()
                                } );
}
کتابخانه WebApiThrottle