Even though most internet connections are getting faster, it’s become increasingly important to build faster, smarter, and more light-weight websites. Yahoo and Google now factor load speeds into their rankings, which makes it even more important.
In order for a website to load quickly it must be built correctly from the ground up. Images, scripts, stylesheets, codes, etc all must be optimized for the web. I’m not going to get into building a fast site from the ground up, rather, I want to discuss a few ways that you can speed up your site without changing any code.
2. GZipping JS and CSS Files
This will only work if you have access to your httpd.conf file on an apache server. It’s pretty simple and usually most servers have it activated by default. Find your httpd.conf file and add the following lines:
LoadModule deflate_module modules/mod_deflate.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so
Also, you’ll need to add the following line to the .htaccess file in the root of your httpdocs folder:
php_flag zlib.output_compression On
3. Disable ETags
Yahoo’s YSlow plugin typically flags sites for “misconfigured ETags”, in this case, it’s best to just disable them complete by adding the following to the end of your httpd.conf file.
4. Add Expired Headers to Assets
Header set Expires "Thu, 15 Apr 2012 20:00:00 GMT"