Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Throttle requests with Redis #20761

Merged
merged 2 commits into from
Aug 25, 2017
Merged

[5.5] Throttle requests with Redis #20761

merged 2 commits into from
Aug 25, 2017

Conversation

themsaid
Copy link
Member

The normal Request throttler needs more roundtrips to Redis to achieve its purpose, this one is more efficient and more accurate since the whole process is atomic.

  • Normal throttle sends 5 commands to Redis.
  • This one only sends 1

With a great number of requests to the application this could exhaust resources.

@taylorotwell taylorotwell merged commit d0512e4 into laravel:master Aug 25, 2017
@MatanYadaev
Copy link
Contributor

@themsaid How should I use ThrottleRequestsWithRedis conditionally? In my production server I'm using Redis, but on my pipeline I don't. How should I use ThrottleRequests for testing and ThrottleRequestsWithRedis for production?

There's no option to execute config('app.env') in the Http\Kernel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants