Implement rate limiting
Protect APIs from abuse
Paste in your AI
Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.
Implement rate limiting middleware for a [Express/Fastify/Django] API using a sliding window algorithm with Redis. Allow [X] requests per [time window] per IP. Return proper 429 headers (Retry-After, X-RateLimit-*) and whitelist internal service IPs.
Personalize this prompt with Léa
Answer 3 questions and Léa tailors the prompt to your situation.
Use Cases
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Utilisez un script Lua Redis pour vérifier et décrémenter le compteur atomiquement. Sinon, en forte concurrence, la fenêtre glissante peut laisser passer plus de requêtes que prévu. Pour les IP de la liste blanche, sautez totalement le middleware via une condition en début de pipeline.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.
Go further
Similar Prompts
Namespace and Quota Management
Manage a multi-tenant cluster
Build a virtualized list
Handle massive data lists
Social Content A/B Test
Testing and optimizing content
Optimize React Application Performance
Optimize your React application to achieve excellent Core Web Vitals metrics through advanced memoization and code splitting techniques.