Creating a CDN for Craft Assets

Get your assets closer to your end users by creating a simple CDN on AWS. We use Amazon CloudFront, Amazon S3, and Craft's remote volumes to set up a simple but effective CDN for our files.

Start Course
Ryan Irelan

I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.

Creating a CDN for Craft Assets is made up of the following videos:

1 Introduction A quick introduction to what we'll learn in this course. 03:55
2 Setting Up a S3 Bucket as Origin We set up a new S3 bucket as the origin for the CDN and create a IAM policy, group, and user. 07:28
3 Adding a Remote Volume in Craft With our origin S3 bucket created we install the S3 plugin and switch the local volume to a remote volume. 02:16
4 Creating a CloudFront Distribution With our origin server set we can now create a CloudFront distribution and activate our new CDN. 04:35
5 Updating Craft's Remote Volume with CloudFront Distribution As a last step, we update our remote volume to use the new CloudFront URL and ID. 01:51
6 Adding a CloudFront Default Index Page We continue working on our CDN by making a small, but nice improvement: adding a default template that will show when you access the CloudFront URL root. 04:09
7 Adding a 404 Page to a CloudFront CDN Just like before, we want to make sure that invalid requests via the browser return something nicer than just XML. So, let's add a custom 404 response to our CloudFront distribution. 03:48
8 Adding a Custom Domain to CloudFront CDN (with SSL) To make switching CDN providers easier because we won't be tied to a provider-specific URL, we add a custom domain to our CloudFront distribution. 06:24