Skip to content
5 of 5 free left
Rate Limiter Recipe

Rate Limiter Recipe

From a YouTube video Watch the original

Ingredients

  • Middleware called "throat"
  • Cache storage
  • Firebase database
  • Laravel application

Instructions

  1. Use the "throat" middleware to limit the number of requests to a specific logic to three times per 60 seconds.
  2. Create a cache storage to store the online users from the Firebase database and limit the number of reads to five times per minute.
  3. Use the "attempt" method to log the rate and reset the attempts after 60 seconds.
  4. Use the "available n" method to check how many seconds until the attempts are available again.
  5. Use the "clear" method to immediately remove the attempts.
  6. Implement the rate limiter for a specific logic in your Laravel application to reduce costs and comply with API restrictions.
  7. Support the creator by clicking one like and subscribing to their channel.

Converted from YouTube ·

Rate Limiter Recipe YouTube