Become a Patreon and get source code access:
Check out my courses:
Hello everybody I’m Nick and in this video I am going to show you how you can rate limit, or throttle, your ASP.NET Core APIs. Rate limiting is vital for your public APIs because it prevents abuse by bad actors. You can also sell access to specific endpoints or the API as a whole with different rules. We will be using a Nuget package called AspNetCoreRateLimit.
Give AspNetCoreRateLimit a star on GitHub:
Timestamps
Intro – 0:00
IP based rate limiting – 1:10
Client based rate limiting – 8:49
Distributed rate limiting with Redis – 13:39
Don’t forget to comment, like and subscribe 🙂
Social Media:
Follow me on GitHub:
Follow me on Twitter:
Connect on LinkedIn:
Keep coding merch:
#csharp #dotnet #aspnetcore
Life saver🥰🥰
Hello nick we havent discuss about client rules here?
What window is this? NuGet: Packages
It does not looks like nuget package manager one
That's Great Stuff!! Thanks.
Thank you.it was so usuful
Really liked your explanation. Just 2 questions. Can we use MongoDB instead of Redis? How can we see the number of requests per client for reporting or monitoring purposes?
Good tutorial. But, how do we determine the rate limiting request numbers?
this library is perfect, very well thought out
Awesome video, thanks Nick! This will help me in a project I am planning in the near future. Love your content, keep it up!
That's great. I would love to see how can i implement this on previous version of .Net
Something I would like to see is how to consume a rate limited API. There's tons of stuff on creating rate limited APIs for others to consume, not much from the consumer's side.
I keep telling my self where did I see you, your voice and actions is very familiar, today I found it. you are pretty much the same as Ivar the boneless in the Viking series. thanks for the video I appreciate the help
Enjoying your vids!! Can you make one implementing an API developer key administration that supports expiration and retracting the keys
First of all, thank you so much for your videos! They are very helpfull. 👏👏
So, I'm trying use this package and I follow everything as you show but when I make a request for my API I didn't get the response headers related to the throttling. Any idea what could be? I missing something? It as a simple ASP Web API .NET 5 project. Thank you!
Nick, you are amazing, is incredible how you can be serious and funny at the moment of teach. And that gives a lot of points, because when i see your videos you have all my atention.
Keep coding ¡Eres el mejor! 🙂
If it’s relying on headers to track requests it’s going to be very easy to workaround.
Something like NGINX as a reverse proxy would do this properly.
Awesome content, thanks for sharing!
But isn't this will require me to publish every single time I change something in the appsettings configurations.
Excellent video Nick. Very informative.
always love your contents
Nothing to do with this video, all of them you make are extraordinary indeed, but just wanted to say, you are killing us, when I say us I mean us (Java Developers). You really sometimes make me believe that nothing can be compared with C#… Yes, yes… I know the old good saying "You know, everything has its own purpose, and depends where and how you use it. :)", Again, Brilliant work Nick. Euxaristume!
this is interesting. also using many services, I think its the job of ingress controller to do this.
Yesss, I was waiting for this one!
Good stuff. But how can a consumer now rate limit itself to this rate limited API? Across multiple nodes? Know of a nuget package that is this easy to wire into httpclient? Because we’ve rolled our own. Badly.
Interesting… thanks. It is good to know
It's like you were reading my mind. This is the exact topic I was going to research. Thank you.
I use Azure API management to rate limit the requests
👍🏽
Nice video, thanks! Any video plans about background task scheduling in .NET?
Can you do some kotlin videos please? Or can you suggest someone?
Would love to see more content about security.
Excelent video, do you have a load balancer tutorial btw? thankss
Had this in mind, and you came in clutch… can't believe it is that easy…
I was just looking for how to do this the other day, pog.
Nice 👍🏻
Will it impact overall performance ??
Always love your content. I have a question here. Can i do such configuration at IIS level, like defining route based rate limiting based on client ip. I ended up creating an action filter that interacts with redis to achieve distributed ip based rate limiting and using that filter on action methods.
It would be nice if the configuration of each endpoint could set through attributes on the endpoint method instead of using json config.
Amazing video as always Nick, thanks for sharing this knowledge with us!
Exactly what I was looking for! Awesome video! Thank you so much!
Awesome Nick, WE LOVE YOU!!!