- CSS image sprites
- Compiling JS needed on every webpage to one file
- Implementing lazy-loading for images
- Consolidating all meta information (username, CDN address, etc) into one request
- Specifically for AWS S3 browser uploads using signed policy documents: grabbing all the policy documents from the server in one request instead of one request per policy document
Some of these are easier to implement than others. Some of these need to be done only once, and others need to be done with every update or change. It seems that not doing any of this would be easier from a logistical perspective, however I'm also concerned about server performance.
I hope to avoid the boilerplate "avoid premature optimization root of all evil blah blah" comment here. My project is in the early stages, and I see now that establishing the wrong or inefficient API format would be difficult to change later. So, I'd like to ask for advice from those with experience in this matter:
How much loading time would be saved for the user for each request that's consolidated? (i.e. what is the overhead of each request excluding the time spent downloading the actual payload)
Does consolidating HTTP requests substantially reduce server usage/costs? If so, were you able to quantify it? (i.e. what is the overhead of each request excluding database access and "the code that actually does stuff")
Possibly relevant for the second part of the question: my back-end server is nginx serving Django Rest Framework running on Gunicorn hosted on EC2 behind the AWS Load Balancer. Static assets will be hosted on S3 and served from Cloudfront.