So I had a few ups and downs since the last post. Let’s start with the good news. I dramatically increased the speed of the test site again. This time, I used Amazon Cloudfront to be the CDN for my S3 bucket. That was a big help. Here is a screenshot that shows the last two major attempts at increasing the speed.
As you can see from the image, the first big change was gzipping the content. This gave me about 140ms or so bump. The next change was switching to CloudFront, this gave me a 350ms bump and to make it more dramatic that is a decrease in the time it takes to download the website by about 70%. Now the site loads on average in about 150ms from anywhere in the world. Very happy with that.
But it wasn’t all roses
I still need to do a bunch of testing with CloudFront to know a. How much it will cost, and b. If I will need to invalidate the resources every time I post. Unfortunately I can’t do that testing yet. That leads me to the bad news. During my testing/configuring cloudfront, I wanted to delete the contents of a directory. So I typed in rm /path/to/directory (I use linux), then I don’t know if it was me being tired or absentmindedness or what but I though wait I need to delete all the files, not the directory so I added an * but I put in the wrong place so it ended up like this: rm * /path/to/directory. Which for anyone who doesn’t know will delete the contents of the current folder, then the directory that I wanted deleted. By the time I caught it, a bunch of crucial files had been deleted and I was left with that awful feeling that I had done something wrong. It wasn’t a total loss, but it definitely set me back quite a bit. I have to rewrite the plugins I built for the site and retest everything. I am getting there, but it is a long process. The crappy part of it was that I keep my code in git with the repo at bitbucket, and I had recently decided that I wanted to change the names and deleted the repos, but got sidetracked before syncing them up again. Dumb mistake.
Hopefully I will have the site back to where it was by the end of the day and can look at finishing the final pieces this week.