Call (877) SITE-OPT (748-3678)

Code: Combine JavaScript and CSS Files

From Chapter 6: Web Page Optimization

By minimizing the HTTP request load, you can maximize the initial display speed of your content. So, this:

<link rel="stylesheet" type="text/css" href="/css/fonts.css" />
<link rel="stylesheet" type="text/css" href="/css/nav.css" />
<script src="/js/functions.js" type="text/javascript"></script>
<script src="/js/validation.js" type="text/javascript"></script>

becomes this, by combining the CSS files into one file and the JavaScript files into one file:

<link rel="stylesheet" type="text/css" href="/css/combined.css" />
<script src="/js/combined.js" type="text/javascript"></script>
Copyright © 2002-2017 Website Optimization, LLC. All Rights Reserved - Free website speed test - Privacy Policy
Last modified: February 19, 2009.

Follow us on: Twitter, Google+, Facebook, Linked In