How to Use Amazon CloudFront Free CDN to Boost Site Speed
Amazon CloudFront is included in the free tier of Amazon Web Services. It is a fast content delivery network (CDN) service designed to securely and efficiently distribute data, videos, applications, and APIs to users globally via AWS's global edge node network. By caching content and optimizing transmission, it significantly improves website and application loading speeds while providing data encryption and network protection to ensure secure content delivery.

Amazon CloudFront Free Tier Inclusions
As part of the AWS free usage tier, you can start using Amazon CloudFront for free. The free tier includes the following:
- 1TB of data transfer per month to the internet
- 10,000,000 HTTP or HTTPS requests per month
- 2,000,000 CloudFront function invocations per month
- 2,000,000 CloudFront KeyValueStore reads per month
- Free SSL certificate
- Unlimited access to all features
This free allowance is sufficient for most general websites.
Reference: Amazon CloudFront Pricing
Register an AWS Account
Before using Amazon CloudFront, you need to register for an AWS account. You will need:
- A frequently used email address
- A phone number
- A VISA/MasterCard credit card
Click the link: Amazon Web Services to register. When registering, be sure to select the "AWS Overseas Region," as overseas regions do not require enterprise certification.

Enter your email and account name.

Enter the verification code sent to your email to verify your account.

Continue to set your account password.

Next, fill in your contact information. Note:
- Select "Individual" or "Business" based on your actual situation (the author selected Individual).
- Ensure your full name, phone number, and address are filled in truthfully. Do not fabricate information, as this may trigger risk control measures.

You will also need to verify your account using a credit card. VISA, MasterCard, American Express debit or credit cards are supported; UnionPay is not. Fill in your credit card, name, and address information according to your actual situation. A temporary hold of up to $1 will be applied for verification and refunded upon successful verification.

Continue to verify your phone number.

In the final step, select a "Support Plan." The author selected "Basic Support - Free."

After registration, wait for account verification to complete before starting to experience the AWS free tier.
Using Amazon CloudFront Free CDN
Go to Amazon CloudFront and add the website domain you want to accelerate. If you have both HTTPS and HTTP access, you can select matching options. Note that if you choose HTTPS, you must ensure your certificate is valid.

Next, select the protocol type and HTTP. The first line is the Viewer settings. The Viewer protocol policy determines whether to redirect HTTP to HTTPS based on your external access needs. Allowed HTTP methods are the request headers allowed; you can choose based on actual needs. Generally, for file downloads, select the first option; for static websites, select the second; for dynamic websites, the third option is required. If you are unsure, simply select the third option to support all methods.

For CDN optimization strategies, the defaults are fine.

Keep other settings as default and click Create.


Once CloudFront is successfully activated, you will see the subdomain generated for you by CloudFront. Below is the CloudFront CDN management center.

Click Edit to re-adjust the CloudFront CDN settings.

Open the CloudFront domain, and you will see your website's images and other static files.

Amazon CloudFront provides a free SSL certificate. If you want Amazon CloudFront to use your own domain, you need to apply for a free Amazon CloudFront SSL certificate.

Click Request SSL Certificate and proceed to the next step.

Then select DNS verification.

Next, Amazon CloudFront will provide a CNAME record, which is specifically used to verify your domain ownership.

Go to your DNS provider and modify the CNAME record. Once the domain verification is successful, your SSL certificate will be issued.

When creating a CloudFront CDN, full-path caching is enabled by default. If you want to set caching for specific website URL paths, you can configure it in the CDN path settings.

The content to be cached or excluded depends on the Path pattern (case-sensitive), mainly using wildcards * and ?. The rules are as follows:
| Path pattern | Matched file scope |
|---|---|
/files/* |
All files under the /files/ path |
/*.jpg |
All files with the .jpg suffix in CDN resources |
/*.css* |
All files with the .css suffix and those with parameters in CDN resources |
/files/*.gif |
All files with the .gif suffix under the /files/ path |
/a??.mp3 |
All files with the .mp3 suffix starting with 'a' in CDN resources |
Amazon CloudFront can also restrict access by region.

CloudFront CDN provides Asia-Pacific nodes. Below is the node accessed after using CloudFront CDN; the effect is quite good.

CloudFront CDN Costs
Although Amazon CloudFront is free, it has a specific free allowance. When using CloudFront, be mindful of whether you exceed the free limit, as prices after exceeding the limit are quite high.

Please pay attention to site request traffic costs. The free allowance provided by AWS may not fully cover normal usage. Additionally, testing shows that using EC2 as the origin server cannot avoid this cost. Bills are generated daily, so remember to monitor your expenses regularly.
Conclusion
As an excellent cloud service provider, Amazon Web Services offers a certain amount of free usage for CloudFront CDN, which is usually sufficient for small blogs. However, users should be aware that exceeding this free allowance will result in additional charges.