Difference between revisions of "AWS Cloudfront"

From Indie IT Wiki
(Created page with "== 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 u...")
 
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
[http://www.craigerson.com/wordpress-cloudfront-cdn-w3-total-cache/ WordPress CloudFront CDN Setup Using W3 Total Cache]
 
[http://www.craigerson.com/wordpress-cloudfront-cdn-w3-total-cache/ WordPress CloudFront CDN Setup Using W3 Total Cache]
 +
 +
== Web Site Hosting ==
 +
 +
[https://trycatchfinally.dev/posts/how-to-use-letsencrypt-ssl-cert-to-secure-custom-domain-with-aws-cloudfront/ 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.
 +
 +
[[Category:Amazon]]
 +
[[Category:Cloud]]
 +
[[Category:Software]]

Latest revision as of 10:38, 17 July 2023

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.