RSS Cheese Feed

How to Accelerate your Site to Warp Factor 9.9 without paying $99 a month

Ever wish you could deliver web pages and graphics at blazing speeds without having to sell your firstborn?

Before CloudFront Blog Load Times

99% of the content of this blog is now speeding from Amazon’s CloudFront Content Distribution Network. Check the page source code – whatever comes from “cloud.negbox.com” is actually coming from a server at an Amazon location near YOU. Yes, YOU. Not me, not my hosting provider… You.

After CloudFront Blog Load Times

I never thought I would set up my own little CDN in a few hours – I thought these things were hard as hell to set up. Amazon has made it incredibly simple, and you don’t have to pick up the phone to talk to any IT ‘tard. I basically muddled my way through. The really nice bit is that I estimate that for my 3GB of storage and an ungodly amount of traffic on this blog, the monthly cost I would pay for storage, transfer, etc would not exceed a coffee at Starbucks even when I double my realistic estimate. Yup, this is really cheap.

Now imagine hosting your landing page and images on CloudFront. Wouldn’t that be sweet for the PPV mavens?

Turns out Amazon has been offering for some time this service called CloudFront. If you’ve heard of Akamai (by far the biggest name in this field) and other Content Distribution Networks – you know what this is. They put the stuff in a redundant cloud close to the people that request the files. Theoretically if folks from Botswanahilii start requesting your pages, your pages start getting replicated to servers closer to Botswanahilii – That’s the gist of a CDN and I understand CloudFront follows it to some degree – not going to split hairs on this one.

Signing up for Amazon Web Services is dead-simple. Setting up CloudFront is not for the faint of heart – it involved no coding, and can be done easily – but there is little in the way of user-level help screens – you get tons of help pages, but its all aimed at developers. Just do like me: Close your eyes, plug some values that make sense and cross your fingers… You did it on every other test in school – this is no different.

Amazon has a really nice web interface for all their web services… I’m not going to go into how awesome all their other services are – just check them out, they are awesome.

2 – Go into the AWS interface, go to the tab labeled S3 and “Create a Bucket” any name is fine – if it gives you errors, try a more unique name. “Bucket” is probably taken.

3 – Go into the CloudFront tab and “Create a Distribution” and give it the name of your blog, or your pet Iguana, don’t really matter.

3a – Select download for the type (I really don’t know what the difference is – this is how I did it). On the “Origin” drop down, select the name of the bucket you created on step 2

3b – On the CNAME field, put a subdomain you will be creating for this file distribution service. I chose “cloud” so in that field I put in “cloud.negbox.com” … The way NegBox is set up (no www) I could have perfectly well chosen “www” on CloudFront and could serve some static pages from http://www.negbox.com/index.html straight from CloudFront (note it doesn’t do “root” or document finding, so pointing your browser at the root of your CloudFront subdomain returns gibberish).

4 – Go to your hosting provider’s DNS tool or your registrar’s DNS tool – Whoever is doing name resolution for you at the moment – and add a CNAME record. The Cname Record has only two pieces of information – One is going to be the name you want to redirect, in this case “cloud.negbox.com” the other piece of info is WHERE you want to redirect it to – that comes from the AWS interface – when you are looking at the CloudFront dashboard you can see your network’s line that says “Delivery Method, Domain, Comment, Bucket”. That domain name that is something like d87sdhs98.cloudfront.com is the second bit of info you need for the CNAME record.

5 – You’re done. Sorta – Now you need to redirect traffic to the cloud.

To get WordPress working with CloudFront I am using W3 Total Cache from Frederick Townes. I can’t even begin to explain what an AMAZING piece of software the W3 Total Cache plugin is. I am simply amazed it is free – he could charge in the hundreds for this piece of software. One hint, though – Don’t use the current distribution release – get the development build 0.9 from wordpres.org, this new release in the pipeline worked flawlessly with CloudFront.

To really use the plug-in is going to take a bit of time to figure out and learn – but its amazing. It scans your site and uploads to the CDN the files it needs, it minifies and caches your pages an uploads the cached pages, updates your .htaccess, goes through all your posts and fetches any content you’ve linked to, brings it into the media library and then exports it to the CDN… In short, it won’t wipe your butt, but it comes pretty close.

Frederick, you’re a genius with your W3 Total Cache plug-in. Once I got the right version, I could not believe how simple it was to push everything to the cloud – and keep it updated automatically – plus the minification and cache. Hats off.

Heh a good lil quick tutorial. I had thought about this a while ago, the benefits are obvious, but I never actually looked at the possible price. I know Dreamhost offers a really quick integration for their customers.

A while back I wrote a post on how bad my analytics reported on my PPV traffic from my shared hosting plans. However on my dedicated server the load times are like 5-10x better and I still see a big fall out from what I’m actually paying for from what my analytics shows. So sometimes I’m not so sure that load times matter as much as we all think, people are getting faster at hitting that X on the pop up!
My recent post Kicked From an Offer

Mike, for price check out their online calculator here http://calculator.s3.amazonaws.com/calc5.html Its very complete. Its in the same ballpark as any traditionally hosted solution for most intents and purposes – you're not going to rack up a $3000 bill unless you're running animoto.com – Which runs entirely (rendering and everything) on Amazon's cloud.
I saw your post on the PPV view rates – I was thinking of you when I wrote about the PPV mavens. 🙂 … This may be a dumb question, but… Are those analytics for PPV view rates javascript-based? If so I've heard its a good idea to compare to good ole AWstats and other log analysis tools.
Speaking of BlueHost… Damn… I just Googled "Bluehost CDN"… They integratred CloudFront within four months of release and it is a push-button integration – not all this stuff I just did. I smell a trial migration coming at least for one site.

Hey what’s up? I just wanted to call your attention to the fact that your link back to my blog is till showing “how to use W3 Total Cache with Cloudfront from Udegbunam Chukwudi” as the anchor text. Do please change it to “how to use W3 Total Cache with Self-Hosted CDN from Udegbunam Chukwudi”.
Thank you sir ;-).

P.S: Since you say you’ve already made the change do please clear your cache as I’m still seeing the old revision in my browser 😉