Amazon CloudFront works as a fast content delivery network, also known as CDN. It allows you to serve data, videos, applications, and APIs to customers around the world with a high transfer speed.
Site owners use CDN for caching, strengthening security, and handling network spikes too. Once a client loads a webpage, the request will be sent to one of Amazon’s edge server locations. There are more than 225 edge servers globally.
If the edge server already caches that data, it serves the client. If not, the request will be sent to a larger edge server. In case that page hasn’t been cached yet, the request now goes to the origin server hosting that page. This process decreases the load on the origin server and greatly reduces your cost.
In this article, we’ll clarify how CDN impacts your CloudFront cost as well as factors determining your CloudFront bills.
Amazon CloudFront Pricing Packages
AWS provides you with 2 different CloudFront reports, one for billing and the other shows users’ usage activities. For the monthly billing report, you’ll pay for what you use.
You firstly have to pay for the normal Amazon S3 storage to save your objects in S3 buckets. Another cost comes from the GB transferred for each HTTP request from edge locations. Activities such as Origin Shield, deactivation, field-level encryption, real-time logs, and a dedicated IP also cost you a specific amount of money.
There are 3 pricing packages to choose from, including Free-tier, On-demand, and discounted pricing. Depending on your data and company size that you should choose a suitable plan.
This package lets you use up to 50GB of transferred data and 2 million HTTP/HTTPS requests each month for free. In case you use more than this amount, you have to pay for the extra cost.
To get this free storage, you need to sign up as a new AWS customer. CloudFront’s free usage tier gives you a chance to make sure it’s the right fit for you. From this, you can easily adjust your application sizes or improve user experience by shortening their load time.
#2 On-demand Pricing
The on-demand pricing method decides your billing based on your actual CloudFront usage. Depending on the countries and the max amount of data transfer that you will have to pay a different fee.
The table below shows you how CloudFront bills customers taking the on-demand pricing:
ASW CloudFront charges you $0.085 for each GB of the 10 first TB if the data is transferred from USA, Mexico, & Canada edge servers. It would jump up to $0.109 if your edge location is in India.
If you have really large applications and a huge amount of data transfer, it’s recommended to take the Discounted pricing package.
#3 AWS Discounted Pricing
To make use of the discounted pricing package, you must commit to using at least 10 TB monthly for a year-long period. CloudFront also offers a 30% discount to those who sign up for the CloudFront Security Savings Bundle.
The discount percentage will alter based on your committed capacity. This helps save a lot of your expenses when you scale up the business.
Factors Impacting Amazon CloudFront Cost
In theory, your billing will tell exactly how much you use Amazon CloudFront. However, this cost depends on numerous elements, including Origin Shield, Void Request, real-time log, and more.
#1 Origin Shield
Origin Shield is an extra caching layer of your original server. In other words, if there is a request to your original server, it has to go through this Origin Shield. As a result, you can serve users from different locations the same cached content. This Origin Shield service costs you the same fee as HTTP requests.
There is also an option for you to encrypt specific fields so only applications having access to the decryption key can access the private data. You need to pay $0.02 for each encrypted 10,000 requests.
#2 Invalidated Requests
When a user requests a webpage but that link is not available, CloudFront won’t charge anything. You should notice that this is possible for the first 1,000 links only. Since then, each invalidated requested URL will cost you $0.005.
These invalidated links are URLs of the object that you want to invalidate from the edge cache. Once deactivated, CloudFront needs to go back to the origin to get the latest version of that file, instead of the cached version. For more information about invalidated links, refer to this Invalidation doc of Amazon CloudFront Developer Guide.
#3 Field-level Encryption Requests
Field-level encryption helps you protect sensitive data under the HTTPS form managed by the field-specific encryption keys. Field-level encryption request is charged depending on the number of requests needing additional encryption.
For every 10,000 requests encrypted by CloudFront using field-level encryption, you need to pay $0.02 along with the standard HTTPS request fee.
#4 Real-time Log Requests
Real-time logs define the number of requests generated in real-time. It costs you $0.02 per 10,000 encrypted logline requests. The real-time logline information gives you a clear picture of your content delivery performance. As a result, you can monitor, analyze, and accordingly take action.
#5 Custom SSL Certificates for Dedicated IP
For each custom SSL certificate, you’ll be billed $600 every month. The SSL certificate must be associated with one or more CloudFront distributions which use a dedicated IP.
Actually, you won’t pay all $600 each month. It charges you by the hours you use this service. Take one example of a custom SSL certificate associated with one CloudFront distribution. If you use it for 48 hours (2 days) in the whole month, the total is (2 days /30 days) * $600 = $40
#6 Price Classes
Price classes enable you to lower the cost of delivering content out of the Amazon CloudFront. The price varies from $0.085 in North America and Europe to up to $0.170 in South America.
What Are Your Amazon CloudFront Pricing Packages?
We’ve listed 3 different pricing packages for AWS CloudFront for you to choose from. If you own a small business, we recommend signing up for the Free-tier to deliver your content. In case you use it on certain demands, pick the On-demand pricing and pay for what you use only. Discounted pricing, on the other hand, best suites really larges businesses that need to deliver a huge amount of data and applications (over 10 TB)
You might need to pay attention to 6 major factors contributing to your billings. They include the origin shield, invalidated requests, field-level requests, real-time log requests, and custom SSL certificates.
If you still need to know more about CloudFront cost or any of the above information confuses you, just let us know in the comment section below.