Speed Up WordPress By Using Amazon S3 & W3 Total Cache

Many of us may be used to using cloud storage systems like Dropbox or Google Docs to store private data but most website owners are not really aware of the potential of using cloud services for their own websites. Many large businesses have been using Cloud web services for some time to speed up their website load times, reduce their data storage costs and improve their data security. It is only over the last few years that cloud computing has been made readily available and simple to set up for small business owners and private individuals who use WordPress.

There are a huge amount of benefits to using a cloud based services for WordPress – cheaper memory, remote access to files, secure data backup features and improved load times are some of the main reasons to use cloud hosting.  It is surprisingly cheap and easy to set up and in this article we will discuss how you can set up wordpress with a Content Delivery Network (CDN) using Amazon Web Services and  W3 Cache plugin. We have chosen Amazon amongst the many cloud hosting options available due to their flexible pricing structures which make it affordable for smaller sites and great value for much larger sites. This pricing structure, and the the quality of their service has lead them to become a firm favourite.

One of the benefits of setting WordPress with Amazon web services will be to reduce the load times of your users no matter where they are in the world and enable you to add more media rich content to your website without worrying about it crashing or becoming sluggish. In short will be getting the speed and memory of large private servers for a fraction of the cost.

Introduction to Amazon Web Services

Amazon webservices wordpress

Amazon offer Cloud Computing solutions named ‘Amazon Simple Storage Services (S3)’ and Amazon CloudFront (a CDN – Content Delivery Network). These two services work together to save the files from your WordPress site onto Amazon’s Remote Servers. These files are then accessible from multiple locations around the world, optimising load time on the site. A normal host would have servers in one location so someone in Australia would take longer to load a website hosted in the US – this geographical disparity in load time is reduced with a CDN.

How To Set Up Amazon WebServices For WordPress

First of all you need to sign up for both Amazon S3 and CloudFront here. Once you’ve signed up you’ll also have other services at your disposal but you only pay for the services you use.  This is a huge benefit of Amazon, compared to other providers.

1

Once you’re into the user interface, the software is really easy to work with.  The first thing you’ll want to do is create a ‘Bucket’ for your WordPress site.  A ‘Bucket’ is the container for all the files of your website, so if you’re intending on using the interface for more than one site you should create a separate ‘Bucket’ for each site.

3

Once you’ve set up your ‘Bucket’, it’s time to move the files over to the CloudFront CDN area.  Start by selecting ‘Services’ in the top navigation.  Next click ‘Create Distribution’ and select ‘Download’ – this will then use the ‘Bucket’ you just created in the S3 section. Now select ‘Create Distribution’.  You’ll see the distribution show up on the CloudFront dashboard logging its progress.  When the Status column says ‘Deployed’ and the State says ‘Enabled’, then your website is ready to be moved to the CloudFront CDN and you’re ready for the next step.

4

Setting Up W3 Total Cache WordPress Plugin

To upload your files from WordPress to the Amazon CDN, I suggest you use WordPress plugin W3 Total Cache. W3 Total Cache works with any CDN and speeds up your website using a range of caching techniques. Incidentally, this plugin is recommended even without integrating a CDN due to its cache features which will speed up your site (integrating a CDN like Amazon will further reduce load times, especially those many miles from the host location)

Once you have installed the plugin go to ‘General Settings’ within the plugin options and scroll down until you see the options for CDN. Make sure you check enable, and for CDN Type, scroll down to Amazon CloudFront underneath Origin Pull/Mirror, and click ‘Save all settings’.

Next you should go to the CDN page within the W3 Cache options in order to configure the plugin to your ‘Bucket’ previously set up in Amazon by entering in the Access key ID, secret key (found by clicking you name when logged into Amazon Webservices) and selecting the bucket name we want to use (all your buckets should come up as a list if set up correctly).

Next click ‘Test S3 Upload’ button and hopefully you will be grated with a ‘Test Passed’ message after a minute or so. If not, grab a coffee and go over the steps again as something is wrong. Once the test is passed it is time to specify the files you wanted hosted on Amazon S3.

Upload The WordPress Files

Go to the General settings for CDN in the W3 Total Cache plugin and select the type of files you want uploaded. It is recommended you select nearly your whole site so that would include host theme files, host attachments, host wp-includes/files and host custom files.  Once you have slected the file types you want saved to Amazon S3 click ‘Upload Theme Files’. For sites with lots of attachments this process can take some time so be patient.

w3 total cache

Conclusion

Once all your files are upload then that’s it, your site should now be hosted via Amazon’s S3 and all of your images distributed through CloudFront. Hopefully you will see an immediate improvement in load time but I recommend using http://tools.pingdom.com/fpt/ to test load times before and after you make the changes to see the differences. So, how was the experience? Any thoughts? Let me know.