CloudFront Setup for Media Offloaded to Amazon S3

This article assumes that you’ve already set up an Amazon S3 bucket and followed the steps within our Amazon S3 Quick Start Guide.

Once the above steps are taken care of, login into the AWS console and visit the CloudFront page. Click Create Distribution followed by Get Started under the Web delivery method.

Populate Origin Domain Name with the desired S3 bucket, however, leave Origin Path blank. Feel free to customize the remaining options if required, but the defaults are fine in most cases.

Click Create Distribution. CloudFront will begin copying all of your files from the specified bucket to its edge servers. This can take a while depending on the size of your Media Library.

Once the Status has changed from In Progress to Deployed, you can configure WP Offload Media to start serving from CloudFront using the domain provided. However, we highly recommend that you configure a custom domain for your CloudFront distribution. Using the domain name is not great for your site’s SEO. See the doc Configure a Custom Domain for CloudFront with HTTPS for step-by-step instructions.

If you are fine with using the domain name, head over to your WordPress site. Visit the WP Offload Media screen and enter your domain name into the Custom Domain (CNAME) option.

Offload Media - CloudFront Domain

Click Save Changes. All of your media library files will now be served from the CloudFront distributed servers.