It's not very hard to add CDN Distribution to a WordPress app hosted on Amazon Lightsail. But if you are new, it can be cumbersome. This article is to demonstrate how to do it easily.
You might hear about Content Delivery Network (CDN). If not, here is an article explaining "what is CDN?".
If you are not interested to read a long article, here is TL;DR:
In CDN, Lots of small servers run closer to your customer. Content gets cached there and served from the closer server(s) of your customer. In that way, ease the pressure from the main servers.
It is the Amazon Lightsail CDN service. Under the hood, it uses Amazon Cloudfront. It has 300+ points of presence to deliver content closer to your customers. On top of that, it comes with AWS Shield, which protects infrastructure from DDoS attacks.
Are you excited to create your first CDN Distribution? Let's go 🏃♂️
You need to have an existing WordPress application for this tutorial. Don't worry if you don't have one. I covered How to Deploy WordPress Application to Amazon Lightsail in the first part of this series.
Now we are ready to create our first distributions.
Go to home page of Lightsail. Go to Network tab again. This time hit the Create distribution button.
Login to your WordPress application's database, you may follow this. Update the
home to your
wp_options table to your distribution domain.
You can use a custom domain instead of CloudFront's sub-domain. You may follow this tutorial.
You can add Object Storage to your WordPress app with a CDN distribution by following this tutorial.
Hope you enjoyed this simple article and created your first CDN distribution. Ask your questions in the comment. Subscribe to get the next blog post. Thanks 🙏