Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much does a single request to the server cost

I was wondering how much do you win by putting all of your css scripts and stuff that needs to be downloaded in one file?

I know that you would win a lot by using sprites, but at some point it might actually hurt to do that.

For example my website uses a lot of small icons and most of the pages has different icons after combining all those icons together i might get over 500kb in total, but if i make one sprite per page it is reduced to almost 50kb/page so that's cool.

But what about scripts js/css how much would i win by making a script for each page which has just over ~100 lines? Or maybe i wouldn't win at all?

Question, basically i want to know how much does a single request cost to download a file and is it really bad to to have many script/image files with todays modern browsers and a high speed connections.

EDIT

Thank you all for your answers, it was hard to chose just one because every answer did answer my question, I chose to reward the one that in my opinion answered my question about request cost the most directly, I will not accept any answer as correct because everyone was.

like image 884
Linas Avatar asked Dec 06 '12 11:12

Linas


People also ask

How much does it cost to run 1 server?

A recent article by ZDNet showed that in the U.S., it costs about $731.94 per year to run an average server. If you have several on-premises servers, that could translate into a big expense.

What are server costs?

The average cost to rent a small business dedicated server is $100 to $200/month. You can also setup a cloud server starting at $5/month, but most businesses would spend about $40/month to have adequate resources. If you wanted to purchase a server for your office, it may cost between $1000-$3000 for a small business.

How much does server space cost?

On average, a dedicated server can be rented out for $50 to $300 per month. The server rental cost is largely dependant on the amount of CPU, memory, and disk space required. Cloud servers, on the other hand, have a lower price point and can be rented for as little as $5 per month.

How much does a server for an app cost?

An app hosting server can range in price anywhere from $70 per month up to $320 per month, which largely depends on factors, such as the content, the number of active users, and projected growth. You will find multiple hosting options, such as a cloud-based environment.


1 Answers

Multiple requests means more latency, so that will often make a difference. Exactly how costly that is will depend on the size of the response, the performance of the server, where in the world it's hosted, whether it's been cached, etc... To get real measurements you should experiment with your real world examples.

I often use PageSpeed, and generally follow the documented best practices: https://developers.google.com/speed/docs/insights/about.

To try answering your final question directly: additional requests will cost more. It's not necessarily "really bad" to have many files, but it's generally a good idea to combine content into a single file when you can.

like image 130
DigitalDan Avatar answered Oct 27 '22 00:10

DigitalDan