Do you own a website or blog? How fast does it load? Do you think that your site’s speed may be affecting the number of visitors you get? It just might.
You may have been aware that Google has recently announced that a site’s performance will now be calculated into the Page Rank formula in a new Webmaster Tools blog post.
Google Webmaster Tools features Site Performance information, which provides suggestions on how to speed up your website. So let’s start speeding up websites and not only make Google happy, but your visitors as well.
Limit DNS Lookups
Whenever a new domain or subdomain is requested, the domain must be looked up for DNS information, which allows the browser to connect to the domain’s IP address at the server that it is hosted on. Many lookups can delay page speed and it’s best to serve all resources locally when possible.
If you are embedding an image from another site, why not save it onto your own server and host it from there? “Another site” refers to subdomains as well since they have their own DNS information. If your site is blog.techairlines.com, techairlines.com requires another DNS lookup (and vice versa).
I recommend only having additional DNS lookups when necessary such as using a site analytics script (Google Analytics, WordPress.com Stats, etc…) or an ad server (like Google Adsense).
Serve URLs From A Consistent URL
Browsers cache files on the local system so it does not have to be redownloaded next time the user visits that same page or file. Unfortunately, if the same file is loaded from many different URLs, the browser does not know they’re the same, and therefore will not load from the cache.
Loading from cache allows the client to load the page quicker as well as saving your server bandwidth.
This applies to all files including images, CSS, and scripts.
Why have multiple CSS stylesheets? Combine them into one to minimize the number of browser requests by as much as possible. Requesting another URL takes additional time and when it comes to website speed, every millisecond counts.
Many pre-made website templates have multiple CSS files to allow easier editing and finding of each element, however this isn’t necessary as we have a Find and Replace feature these days. So combine the style.css, print.css, and ie-fix.css into one single style.css.
Avoid Unnecessary PHP Queries
Remove any unnecessary PHP queries as well as all other server side programming languages. This is most commonly found in CMS platforms such as WordPress. A guide to doing this can be found here.
Simply cut and paste all scripts from the head section of your HTML and place it right before the closing body tag.
To do this in WordPress, simply add the following lines to your theme’s functions.php file and all scripts that are injected properly into WordPress’s head section will be moved to the footer.
Enable Server Side Compression (Advanced)
Note: Page compression often uses quite a significant amount of CPU power therefore is not recommended on shared hosting configurations as your host will likely suspend you for high resource consumption.
Compression is exactly what the name implies. Pages are compressed before sending it to the user. When the client requests the URL, the server would then compress the file, and send the client’s system a compressed version of hte page. The client’s browser will be uncompress it and display the page. This not only speeds up page loads but can save significant amounts of server bandwidth. As a trade off, compression consumes extra CPU power.
A simple way to enable this is to add the following lines to your root .htaccess file (for Apache servers supporting .htaccess):
# compress all text & html: AddOutputFilterByType DEFLATE text/html text/plain text/xml
Another method would be this:
# Compress certain file types by extension: <Files *.html> SetOutputFilter DEFLATE </Files>
If the browser the client is using does not support un-compression, the server should recognize that and the page will then just be served normally.
Every millisecond of a site’s loading time is important and its crucial to limit the time it takes for a client to load your website as much as possible. This can also increase the chances of the client staying around your site longer and reading your content rather than waiting for the pages to load. Page speeds now count for about 1 percent of your Google PageRank, which might not be much but a very slow website could make a big difference.
Do you have additional suggestions for speeding up websites? Share them in the comments.