AWS Cloudfront

From Indie IT Wiki

Introduction

Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and image files, to your users. CloudFront delivers your content through a worldwide network of data centers called edge locations. When a user requests content that you're serving with CloudFront, the request is routed to the edge location that provides the lowest latency (time delay), so that content is delivered with the best possible performance.

WordPress CloudFront CDN Setup Using W3 Total Cache

Web Site Hosting

How to use a Let's Encrypt SSL certificate to secure a custom domain with AWS CloudFront

WordPress Tweaks

Yabe Webfont

In order to successfully use hosted fonts, you need to add a Behaviour to your Cloudfront Distribution.

AWS Console > Cloudfront > Distributions > YOUR-ONE > Behaviours > Select > Edit > Response headers policy > SimpleCORS > Save Changes

You also need to edit your NginX configuration to add the extra header for Access-Control-Allow-Origin *:-

 # Caching
 location ~* \.(jpg|jpeg|gif|png|webp|svg|woff|woff2|ttf|css|js|ico|xml)$ {
   access_log        off;
   log_not_found     off;
   expires           360d;
   add_header        Access-Control-Allow-Origin *;
   add_header        Pragma public;
   add_header        Cache-Control "public, must-validate";
 }

Then restart NginX.