Theme4Press Forums alora huge js/css loaded in main html file? Re: huge js/css loaded in main html file?

Spiros Doikas
Post count: 49
#8864 |

I think having the actual content as far as close to the top of the code is better. Please also refer to:

Putting Your Pages on a Diet With CSS
Pages that use linked external CSS style sheets, rather than embedding a lot of style in the HTML, are lighter weight. These lighter files are faster to download for users who are browsing your site, as well as for search engine spiders. In addition to downloading smaller HTML files, CSS files are typically shared by multiple pages and cached by the user-agent (i.e., the web browser for human viewers, or the spider program for the search engine). So each time a new page is loaded and the browser or crawler sees the <link> statement including the stylesheet, it does not reload it since it already knows about it.

Lighter pages make it easier for search engines to discover your on page content. It also makes your pages much easier to manage.

Among the many things that you can do to improve the search engine optimization (SEO) of your web pages, one of the easiest and important thing is to improve on the page load time. It has been shown that improving the page speed leads to better user experience, user engagement and thus, indirectly better search engine optimization. Avoiding the CSS @import statements in your stylesheets are just one of those things to do to improve SEO

Using multiple CSS @import statements inside the HTML source (as opposed to within the CSS file) to include stylesheets does not affect the page load times in most modern browsers. It is the @import statements with an CSS file that is most detrimental to the page load times. You are still discouraged from using the @import statements within the HTML page, because older versions of MSIE loads it later as if it was included at the bottom of the page. So, it is best not to use it.

Minify, Unify and Move Down JavaScript
So, the best strategy here is to load JavaScript last (i.e. after your CSS is loaded). To do this, place JavaScript at the bottom of your HTML document where possible. Best practice recommends doing this right before the closing <body> tag.