Google PageSpeed

It Matters

Posted 1 year ago by Tom Maiaroto.


So I recently built a viral news aggregation site and I wanted to ensure it loaded nice and fast. Also keep in mind that Google will rank your site higher if it loads fast - it's been a well known factor in their rankings for a while now. They even created this cool set of tools called PageSpeed to help you with that effort.

First, you can see how your web site fares with regard to their standards by using their tools. I really have yet to see a major web site that actually scores nicely. None of the major news outlets that we all use every day rank so well. Sure, we have broadband and things load fast enough anyway - and even on our mobile devices now. However, it's still a good idea to optimize.

Why? That's easy. It cuts down costs and improves user experience. Even if your users are loading a site only a second faster...Or fraction of one...It's better for them. If you don't care about your users, then care about your wallet. Your hosting bill for transferring data will be much less expensive, even if you're saving only a few kilobytes per page load. One kilobyte times three hundred million page views is more than 286GB. That's well over $40 by current bandwidth charges from Amazon and many other services. Sure, if you get 300 million pageviews per month then you should be able to afford an extra $40...But let me remind you, that's just one kilobyte of data. It is quite easy to reduce the size of many popular web site landing pages by a full megabyte or more!

This means that companies are literally losing thousands of dollars per month simply because they didn't take a few moments to compress their assets and think about how they built their web sites. Just enabling compression on a web server is only one (important) piece of the pie. There are actually several other things you can do including hosting files, such as JavaScript, from a public CDN like Google's free one for jQuery and so on. However, we do have a lot of custom JavaScript and assets for our sites so we can't always get away with tricks like that. Compression alone isn't enough. You need to optimize your content.

Many developers already use tools like CodeKit to compress their JavaScript along with other tools for CSS like TinyCSS. However, many also don't. Enter a second option: Google PageSpeed. Google actually provides us with these awesome web server modules (for both Apache and Nginx) that automatically take care of asset optimization. Don't forget that not only can you optimize JavaScript and CSS simply by removing whitespace, but you can also compress images. Often times tools like Photoshop don't give us the best results. Especially if the designer exporting those images doesn't understand the need or importance for the web. It's really not uncommon for a designer to prioritize image quality over file size. However, there is a good middle ground there.

Installing Google PageSpeed for Apache is pretty easy and they have instructions for it. They also have instructions for Nginx but what if you didn't compile from source? What if you used a package manager? Well, I found someone maintaining an Ubuntu package repository for Google PageSpeed for NginxIt worked for me with ease on Ubuntu 12.10 after getting the add-apt-repository tools, adding the repository to your sources and the installing and configuring your Nginx to use it.

There's even a nice statistics page that shows you how many bytes of data you're saving. In in other words, you can literally calculate and estimate your savings on hosting.

You should definitely do this and watch your PageSpeed rating improve, make your visitors happier, and of course make your wallet happier.


Filed under
comments powered by Disqus

Search for Posts

Popular Labels

social media virality score general internet web development reviews and opinions php web tools hosting lithium web design

Recent Posts