How Many API Calls Are Too Many for a Frontend with 300-400 Daily Users?

0
44
Asked By CreativeNinja42 On

I'm developing a project for a client with around 300 to 400 daily active users. Currently, my frontend is making about 12 to 15 API calls per page. While everything functions well, I'm unsure if this is a standard number, excessive, or perfectly fine. I want to avoid premature optimization but don't want to release something inefficient. What would be an acceptable number of API calls from the frontend to the backend for an average page? Are there any benchmarks or best practices I should consider?

7 Answers

Answered By DataNinja33 On

The purpose of the API calls often matters more than the number itself. If they are all basic CRUD operations and not too resource-intensive, you’re likely fine.

TechSavvyUser -

All of the calls are basic CRUD, nothing too heavy!

Answered By WebDevFanatic On

Just check out any major website using developer tools. You'll find that 12-15 API calls is really a small number. Bigger sites make many more calls than that!

Answered By EpicCoder93 On

Tree Fiddy.

Answered By CuriousCoder On

Are the API calls made simultaneously on every page? How many pages does an average user visit per session? Any caching involved? Many social media sites manage a lot of requests, especially after the first visit, with a caching layer like GraphQL to help.

FrontendWiz -

Yeah, the calls happen on every page. Most users are logged in and using the site continuously. I have some caching for a few endpoints, but it's mostly plain REST right now.

Answered By TechGuru88 On

It's tough to say without specifics. Are you including resource calls, like images, in those numbers? Also, how your page handles the calls — do they block each other, or is your page setup to load parts of it lazily? That's a big factor.

FrontendWiz -

No resource calls, all 12-15 requests are to my own API server. Most of them are independent, so they can be done in parallel, but right now, I haven't optimized anything yet.

Answered By OptimizationExpert On

There's no magic number of requests that fits everyone. The key is performance. As long as your site loads quickly and your server scales well, your current number of requests is likely okay. But keep an eye on performance, especially on mobile networks where slower speeds can become an issue.

TechSavvyUser -

That makes sense! Currently, both the site and server are running smoothly, which is good. I'll definitely monitor performance as the user base grows.

Answered By LazyLoaderPro On

You could consolidate some of the API calls on the backend. Consider creating page-specific routes and optimizing your database queries for those. This way, you maintain the benefits of individual calls while blending them for certain pages.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.