Posted by Kromey at 7:28pm Nov 21 '09
You must sign in to send Kromey a message
You must sign in to send Kromey a message
is to simply combine+minify all your JS and CSS files ahead of time. The main disadvantage here is that if you have some JS or CSS that's maybe used only once in a single location buried deep within your site (i.e. not frequently visited) gets loaded with every page. However, the impact of this is usually mitigated if you properly configure caching controls on your server - the user downloads the single JS or CSS file once, and then never again.
Also, by minify-ing the files, you reduce the amount of data that gets downloaded to begin with.
Now, the first visit to your site (on an un-primed cache) generates a single request for each of the JS and CSS files, and subsequent visits (now that we've primed the cache) do not make any requests for JS or CSS, thereby significantly reducing server load for you and page load time for your visitors.
Also, by minify-ing the files, you reduce the amount of data that gets downloaded to begin with.
Now, the first visit to your site (on an un-primed cache) generates a single request for each of the JS and CSS files, and subsequent visits (now that we've primed the cache) do not make any requests for JS or CSS, thereby significantly reducing server load for you and page load time for your visitors.