Whoooooosh – the Recycling Group Finder gets faster

This afternoon I implemented a CDN (Content Distribution Network)  for the Recycling Group Finder, it only took about an hour and has slashed page load times on the site.

Whilst working for Engine Yard today (yes, on a Saturday!) we got a ticket in asking for CDN recommendations. This got me thinking about the recently announced Amazon Cloudfront CDN, specifically how cool it would be to use it for the Recycling Group Finder (a personal project). It’s an internationally targeted site and would benefit from the faster page load times a CDN will bring.

Why Cloudfront?

Cloudfront is built on Amazon S3, a well-used and trusted technology and many of Engine Yard’s customers are already using it. The chances are if you’re already using S3 for storing assets Cloudfront will be dead-simple to get running. I wasn’t, though it didn’t take much extra effort.

It’s easy…

Really easy. There’s a really useful tutorial up that gets you most of the way there, the Firefox S3 plugin is amazing. All that was needed after that was a single line change to my environment.rb file in my RubyonRails project:

and my javascript and CSS files were being served super-fast from the Cloudfront CDN. Sweet! It took a bit more work (and a custom helper) to get some of the other assets served, but not much.

Very. Very. Fast.

The speedup is significant. The site seems snappier when visiting in a browser but I also ran some before and after speed tests using the Pingdom tools page. The results were impressive. The homepage went from a 16.1 second load time (including all assets) to 1.1 seconds:

Before (16.1 seconds):

Homepage for Recycling Group Finder served from server

After (1.1 seconds):

Homepage for Recycling Group Finder served from Cloudfront

The homepage saw the most impressive speed boost, but sub-page load times improved significantly too. This is the before and after tests for the San Francisco Freecycle page:

Before (5.6 seconds):

Recycling Group Finder sub-page served by the server

After (1.6 seconds):

Recycling Group Finder sub-page served by the Cloudfront CDN

Worth the effort

Hell yeah! It took a really short amount of time to get running (helped by RubyonRails built in support for asset hosts) and the site flies. Give it a go!

Tagged

4 thoughts on “Whoooooosh – the Recycling Group Finder gets faster

  1. Ian M says:

    Hey Will,

    Have you ever thought of trying to do a freecycle poster or reader ?

    I’d be up for collaborating on something like that.

    Ian

  2. Louise says:

    I keep getting a 503 error, and I’m only a teensy bit geek, so I have no idea what the problem is.

    Is the finder still up and running??

  3. Nick says:

    Any issues with assets being cached when you longer wanted them to be cached? Like say you made a change to your css – how does Cloudfront know to expire the asset?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.