rate-limiting

Implement fixed window, sliding window, and token bucket rate limiting in ASP.NET Core with Redis.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill rate-limiting-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rate-limiting
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/rate-limiting
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill rate-limiting-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill protects your ASP.NET Core applications from abuse and ensures fair resource usage by implementing robust rate limiting strategies.

Core Features & Use Cases

  • Flexible Algorithms: Implement fixed window, sliding window, and token bucket algorithms.
  • Distributed Limiting: Integrate with Redis for scalable, multi-server rate limiting.
  • User & Client Identification: Apply limits based on user identity, API keys, or IP addresses, even behind proxies.
  • Use Case: Protect your public API from being overwhelmed by implementing a global rate limit of 1000 requests per minute, with stricter limits for login endpoints.

Quick Start

Configure ASP.NET Core's built-in rate limiting middleware with a global fixed window limiter for anonymous users.

Frequently Asked Questions about rate-limiting

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement rate limiting in ASP.NET Core to prevent API abuse?

Implement rate limiting in ASP.NET Core by configuring built-in middleware with fixed window, sliding window, or token bucket algorithms. This prevents denial-of-service attacks and ensures fair resource allocation across clients.

Can I apply different throttling limits for specific API endpoints and user types?

Apply differentiated throttling limits by identifying clients via IP addresses, API keys, or authenticated users. This allows stricter rate limits on sensitive endpoints like login while maintaining global limits for general API traffic.

Does ASP.NET Core rate limiting work with Redis for distributed multi-server environments?

Distributed rate limiting with Redis supports multi-server ASP.NET Core environments. This ensures consistent throttling across all application instances, preventing users from bypassing limits by targeting different servers.

What is the difference between fixed window, sliding window, and token bucket rate limiting algorithms?

Fixed window limits requests per set time period, sliding window tracks requests within a moving timeframe for smoother limits, and token bucket allows burst traffic by accumulating tokens. Choose based on your API security needs.

How do I correctly identify client IP addresses for rate limiting behind a proxy?

Identify client IP addresses behind proxies by configuring ASP.NET Core middleware to read forwarded headers. This ensures accurate client identification for applying rate limits to the correct users rather than the proxy server.

When should I use token bucket throttling instead of a fixed window limiter?

Use token bucket throttling when your API needs to handle burst traffic gracefully, allowing short periods of high request volumes. Fixed window limiting is better for strict, uniform request caps to enforce rigid resource management.