P
💻DeveloppementIntermediateAll AIs

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

Protect APIs from abuse

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • 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

💻DeveloppementIntermediateAll AIs

Namespace and Quota Management

Manage a multi-tenant cluster

0110
💻DeveloppementAdvancedAll AIs

Build a virtualized list

Handle massive data lists

0143
💻DeveloppementIntermediateAll AIs

Social Content A/B Test

Testing and optimizing content

098
💻DeveloppementIntermediateChatGPT

Optimize React Application Performance

Optimize your React application to achieve excellent Core Web Vitals metrics through advanced memoization and code splitting techniques.

36394