Craigerson

Motorcycles, Blogging, Development, & More

  • Home
  • Blog
  • Links
  • Contact
  • About

Amazon CloudFront And W3 Total Cache Origin Push

Last updated on January 2, 2018 By Craig 6 Comments

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.

amazon cloudfront and w3 total cache origin push

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.

Origin Pull

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.

Origin Push

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.

Filed Under: Blogging Tagged With: CloudFront, Origin Push, W3 Total Cache

Comments

  1. Shawn Lehner says

    September 28, 2017 at 8:33 pm

    You mentioned you weren’t sure why someone would want to use Origin Push over Pull. The main situation where Origin Push is important is when you have multiple Web Servers for a single site behind a load balancer. Pulling from the Web Server by Cloud Front assumes that the Web Server has your file available. In the situation I mentioned above, not all Web Servers would have the file so you can’t rely on hitting the Load Balancer and getting the asset. However, Origin Push allows you to push the uploaded files to S3 so that it does not rely on all Web Servers having the file.

    Reply
    • Craig says

      September 29, 2017 at 10:42 am

      Thanks for the feedback Shawn!

      Reply
  2. Jeff says

    January 18, 2018 at 3:31 pm

    Hi Craig,

    Nice set of articles on both origin pull and origin push. One thing I don’t quite understand is why you need an S3 bucket with origin pull. It really shouldn’t be necessary, since Cloudfront uses your webserver as the origin. However, I haven’t gone through the automated steps with W3 Total Cache, yet. It’s possible the plugin is setting up some rules / behaviors behind the scenes.

    FYI, Amazon has posted a very detailed article showing a mixed setup using multiple origins for the same distribution: pushing static files to an S3 bucket and pulling dynamic data from your webserver / load balancer. I found it very interesting and informative:

    https://aws.amazon.com/blogs/startups/how-to-accelerate-your-wordpress-site-with-amazon-cloudfront/

    Also, for anyone else in the same situation, I wasn’t aware that W3 Total Cache handled CDN use. I originally setup WP Offload S3 Lite and am now finding that I don’t need it.

    Thanks!

    Reply
    • Craig says

      January 18, 2018 at 5:18 pm

      Glad you liked them Jeff. For the life of me I can’t figure out why you need an S3 Bucket created for the Origin Pull. Couldn’t get it to work without this. There seems to be something going on there. If you happen to discover something different, please let us know. Also thanks for sharing those articles, I’ll have to take a look.

      Reply
  3. Chris says

    February 14, 2018 at 4:34 pm

    Hi Craig,
    Fantastic set of articles. I’ve successfully set up the WordPress site to use a S3 Bucket combined with Cloudflare and CloudFront using the Push method.

    However, our front end is an Angular Universal using the WordPress Rest Api. The W3 Cache doesn’t appear to work with the Rest Api, unless I’m missing something.

    Reply
  4. Thiago Lima says

    January 27, 2022 at 12:50 pm

    Really good point presented by Shawn Lehner.

    Another good use case which is important to me is when you want your cloudfront to handle webp conversion.
    By having the files on s3 and settings request and response edge lambdas we can resize the images on the fly and store the new dimensioned webp images into s3, this is not achievable through pull mechanism.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • My First NFT Collection (Free NFT Offer)
  • Sourdough Recipe Calculator
  • My New Homebrewing Hobby
  • How To Start A WordPress Blog: A Video Series
  • My Triumph Thruxton Modification Video

Categories

  • Blogging
  • Development
  • Featured
  • Misc
  • Motorcycle Monday
  • Motorcycles
  • NFT
  • Technology
  • Tuesday's Triumph

Legal Stuff:

I declare that I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com.

Tags

Ace Amazon CPM apple watch AWS Hosting Bell bobber bonneville buell blast CloudFront dominator EC2 Instance Elastic IP exhaust face shield fermentation gas cap gas mileage Genesis hagon harley davidson ios10 JavaScript Kriega landline mpg Origin Push phone redirect rs1 selling shaving shock absorber sourdough tail bag Thruxton touring Triumph triumph bonneville Triumph Thruxton Video visor W3 Total Cache watch os3 WordPress wordpress cloudfront

[footer_backtotop]

Copyright © 2025 Craigerson - All Rights Reserved