I recently created a post on how to set up a CDN for your WordPress blog, using Amazon CloudFront and W3 Total Cache. That post focused on setting up an Origin Pull with CloudFront. Another option available in W3 Total Cache is setting up a Origin Push for your CDN.
In this post we’ll examine setting up a CDN with Amazon CloudFront and W3 Total Cache Origin Push settings.
CloudFront Origin Pull vs. Origin Push
First off, let’s explain the difference between setting up a CloudFront CDN with Origin Pull vs. Origin Push.
My previous post focused on CloudFront using the Origin Pull option. In my opinion, this is by far the easiest option to choose.
An Origin Pull does exactly as it sounds. The CloudFront distribution will pull the required files directly from your Web Server. There is nothing special required of you to move files around, CloudFront will take care of all the heavy lifting for you.
An Origin Push is exactly the opposite. You need to push your files to the CloudFront distribution. Actually that’s not completely true. The CloudFront distribution will still get your files, but it does this via an S3 Bucket. You need to push the required files to your S3 Bucket in order for the distribution to retrieve.
Anytime a file is added or changed on your blog, using Origin Pull will result in the CloudFront distribution retrieving that file directly from your Web Server. With Origin Push, you have to physically move that added or changed file to your S3 Bucket, in order for the CloudFront distribution to retrieve that file.
I’m really not sure why anyone would go with Origin Push over Origin Pull. In my opinion, it’s far more involved and I don’t really understand the benefits. With that said, here’s a good article that seems to describe why you would want to use Origin Push vs. Origin Pull.
Amazon CloudFront And W3 Total Cache Origin Push
Instead of my writing a massive post on how to set up Amazon CloudFront and W3 Total Cache Origin Push, I thought it would be easier sharing the video I created.
You’ll want to check out my previous post on setting up a CDN with CloudFront. There are a number of things covered in that post that I don’t get into with this video, such as:
- Setting up an S3 Bucket
- Creating a User Group and User using Identity and Access Management
- Setting up your CloudFront distribution
Whether you are planning to use Origin Push or Origin Pull, the above three steps are identical.
Once you have an understanding of those basics, you’ll be ready to setup Amazon CloudFront and W3 Total Cache Origin Push.
Let’s take a look at setting up an Amazon CloudFront Origin Push distribution:
You can also view this video directly on YouTube.