: 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
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?
More posts by @Kevin317
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.