Current section: Rate Limiting 4 exercises

Optimizing Your Express Server with Rate Limiting Middleware


00:00 There's no situation in the world where it would make sense for somebody to sit here and go refresh about a bajillion times in a minute. That just wouldn't make any sense. They're probably trying to do a denial-of-service attack or something, and the fewer resources we can allocate to somebody doing something

00:17 like this, the better. So I'm just going to keep going because we haven't implemented this yet. So what we're going to be doing in this exercise is adding a single rate limit configuration so that we can make sure that users cannot hit our servers a bajillion times unnecessarily. We're going to go with

00:36 something a little bit more reasonable for the types of GET requests people are going to be making. Now people, of course, they're going to be navigating to a bunch of different pages and stuff, and so you do want to be reasonable with the rate limiting that you've got. But yeah, anybody who's doing something like this

00:52 probably should get rate limited. We should be like, whoa, slow down, before we even let them into our actual AppLogic. So we're going to add the express rate limit middleware so that we can stick that in place before we get into our AppLogic to save our servers a little bit of the work of handling all these

01:10 GET requests. So have a good time. We'll see you when you're done.