Yesterday, Amazon released their CloudFront Content Delivery Network (CDN), which finally makes true, fast CDN’s available at an affordable price to mere mortals.
As usual, I jumped on the challenge and quickly implemented a Joomla! 1.5 native plugin for the service. This plugin automatically moves your sites static content (images, css, javascript) to the CloudFront CDN, thereby providing faster loadtimes for your users … especially those users that are geographically “far away” from your servers.
Setting up the service was extremely easy. First, I had to get the content ready and upload it to an S3 bucket. While arguably easy using the s3sync command line tools, the process is complicated by the fact you need to choose exactly “which” files to upload, setting the right headers, and, for more advanced users, gzipping them in advance (more on that later).
Once I had my staging area ready, I just uploaded everything to S3. Then, using the simple but effective PHP based client, I registered the bucket, and received a cloudfront.net domain that can be used interchangeably with the s3 bucket, but is actually on the CDN.
Configuring Joomla! was even easier. I uploaded the CloudFront plugin, told it the current domain and path of the site, and the new path using the CDN. Then I published the plugin – and bingo! All static content is now being served from CloudFront instead of my local server.
A bug or a feature – I haven’t decided which, yet, – is that the not only the front end Joomla! files are being served from the CDN, but the backend files (administrator) are, as well. I may make that ‘configurable’. While I like saving a second or two from each request, I’m not sure I want that to happen in all cases.
A side advantage of this setup – now that my webserver no longer serves static content – is that I can optimize it for PHP.
Before turning on the CDN, I took screenshot of the site (a stock Joomla! site) with YSlow. You can see the image here (big picture opens in a new window):
http://itest.s3.amazonaws.com/nicktemple/images/J-NOCDN.png
The biggest thing to notice is that YSlow gives this site a big ‘F’ for performance … 46 out of a posible 100. But remember, an F is still 1/2 an ‘A’ :->
Now, after turning on the plugin, we do a little better … a ‘C’ grade, with a numeric score of 76.
http://itest.s3.amazonaws.com/nicktemple/images/J-CloudFront.png
Wow! A big improvement!
Note, though that, YSlow doesn’t yet know that ‘cloudfront.net’ is a CDN, so you must tell it, using the instructions found here: http://developer.yahoo.com/yslow/faq.html#faq_cdn
Overall, I’m extremely impressed with the service, and am using for my sites and my largest customer sites. There are two downsides right now:
a) CloudFront doesn’t currently support ‘gzipped’ content, nor does it support ssl. There are some workarounds discussed on the forum, so it isn’t a performance show stopper. It just makes setting up the staging server a little more difficult.
b) Setting up the staging server isn’t particularly “easy”. This is not fault of CloudFront, but rather the fact the tools there aren’t quite ready for most non-developers to use, yet. That’s the portion we’ll be working on over the next few weeks by building a service that allows you to easily manage CloudFront for your Joomla! powered site.
Finally, there are additional performance improvements that can be made to Joomla! For example, combining and minimizing the Javascript and possibly some of the css, as well as caching some of the work the CloudFront Plugin is doing could increase response times for most Joomla! powered websites dramatically.
Signup now (upper right) to be notified when these products are available.
While I’m not yet releasing the plugin except to current customers, if you’d like to hire my company Intellispire to implement CloudFront for your website, please click here to contact us.
P.S. If you are a WordPress or Drupal developer, contact me … I’d like to discuss porting some of our products to other CMS’s, too. Contact me!


{ 1 comment… read it below or add one }
Hi,
I saw your post and wanted to encourage you to post a link for your plug-in on the CloudFront Resource Center here – http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=217
Please let me now if you have any trouble submitting.
Regards,
-Tal
{ 1 trackback }