Mobile app version of vmapp.org
Login or Join
Kevin317

: What are the performance implications of loading static files as links vs. sending everything (including static files) inline I was wondering what would be faster: Loading Static Files vs. Sending

@Kevin317

Posted in: #Html #LoadTime #Performance #Server #Static

I was wondering what would be faster: Loading Static Files vs. Sending everything (including static files) in one HTML file?

For example if I had a page that needs:


jQuery
font awesome
CSS


I could:


add links to the scripts and CSS files
or add all of theses things in one HTML document


Which would be more efficient for me to serve from a web server?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kevin317

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

It depends how many pages each of your visitors sees.

I have a a currency conversion site where almost all the users view exactly one page. They land a currency calculator that is specific to the two currencies they want to convert. After performing their calculation, they leave the site. To optimize the site performance, the entire page is one request. I inline the JavaScript, CSS, and even images using data URI.

This drastically improves the performance of the first page of a users session. It gets it down from 800ms to 400ms because there isn't any waiting around for additional resources.

On the other hand, when everything is inline, all the resources have to be served on every page view. If you have large JS, CSS, and images; you don't want to have to keep resending as the visitor views more pages. In that case it is a good idea to make the first page load slightly slower in exchange for faster subsequent page load times.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme