Back to all Resources

CloudFront cost: how to understand and reduce them – and save the planet while you’re at it

In this blog, you’ll learn how to reduce your CloudFront costs and save the planet.

What is Amazon CloudFront?

Amazon CloudFont is a Content Network Delivery service (CDN).

CDNs are primarily used to reduce latency.

They do this by serving certain types of content (images, videos and static files) from servers that are geographically closest to any particular user. I.e. users in France will receive content from the server in Paris; users in Malaysia will receive content from the server in Kuala Lumpur.

Why create a guide to reducing CloudFront costs?

At Turn It Off, we’re committed to shrinking the cloud industry’s carbon footprint. We help businesses reduce their cloud bills whilst becoming more sustainable.

We do this through our AI-powered platform which turns off cloud applications, environments and resources when not in use – and by sharing a little knowledge.

Understanding CloudFront costs

AWS Free Tier

AWS offers a free tier to those using CloudFront for small projects. For most businesses, this won’t be enough. But start-ups might get their first months absolutely free.

Free Tier usage restrictions
  • Up to 1TB of data transfer out per month
  • 10,000,000 HTTP or HTTPS requests per month
  • 2,000,000 CloudFront Function invocations per month
  • Free SSL certificates
  • No limitations, all features available
How does this affect CloudFront pricing?

For most businesses, the AWS Free Tier has two benefits:

1) It allows you to experiment with CloudFront features since there are no restrictions on which parts of the service you can access. This can be great for finding your feet.

2) It remains free for every account. So, the first 1TB of data transfer is always free.

Other factors affecting CloudFront pricing

The main factors affecting CloudFront pricing are:

  • Data transfer out
  • Price classes
  • The use of edge computing
  • Regional data transfers
  • The number of requests made
  • Cache invalidations
  • Origin shield requests
  • Additional features 

Data transfer out

What does this mean?

Data transfers into CloudFront are free as long as they are from other AWS services. For instance, if you’re loading content into your CloudFront CDN from an Amazon database, you won’t be charged.

However, data transfer out of CloudFront is one of the main sources of cost you’ll encounter.

How does this affect CloudFront pricing?

Below are the current costs per region:

  • United States, Canada and Mexico – $0.085 per GB
  • Europe and Israel – $0.085 per GB
  • South Africa, Kenya and the Middle East – $0.110 per GB
  • South America (excluding Mexico) – $0.110 per GB
  • Japan – $0.114 per GB
  • Australia and New Zealand – $0.114 per GB
  • Hong Kong, Indonesia, Philippines, Singapore, South Korea, Taiwan, Thailand, Malaysia and Vietnam – $0.120 per GB
  • India – $0.109 per GB

Price class

What is this?

All countries contain CloudFront edge locations. However, it’s up to you if you’d like to take full advantage of them.

How does this affect CloudFront pricing?

By default, CloudFront will serve content from the nearest edge location, meaning the maximum price will be applied.

However, if you want to save money, you can pay a lower price class, causing some latency for your users in certain areas.

Below are the price classes for various regions’ edge locations:

Edge locations included within the United States, Mexico and Canada

  • Price Class All: Yes
  • Price Class 200: Yes
  • Price Class 100: Yes

Edge locations included within Europe and Israel

  • Price Class All: Yes
  • Price Class 200: Yes
  • Price Class 100: Yes

Edge locations included within South Africa, Kenya and the Middle East

  • Price Class All: Yes
  • Price Class 200: Yes
  • Price Class 100: x

Edge locations included within South America

  • Price Class All: Yes
  • Price Class 200: x
  • Price Class 100: x

Edge locations included within Japan

  • Price Class All: Yes
  • Price Class 200: Yes
  • Price Class 100: x

Edge Locations included within Australia and New Zealand

  • Price Class All: Yes
  • Price Class 200: x
  • Price Class 100: x

Edge locations included within Hong Kong, Indonesia, Philippines, Singapore, South Korea, Taiwan, Thailand, Malaysia and Vietnam

  • Price Class All: Yes
  • Price Class 200: Yes
  • Price Class 100: x

Edge locations included within India

  • Price Class All: Yes
  • Price Class 200: Yes
  • Price Class 100: x

Use of edge computing

What is this?

While CloudFront is mostly used to transfer static files and content, it also allows for small pieces of code to be run at edge nodes.

This is done by two services:

  • CloudFront Functions runs simple Javascript and can be used to perform tasks like modifying styles and headers
  • Lambda@Edge allows for more complex operations like authentication or payment processing

In both cases, the benefits of running this code closer to the user are the same as that of serving content closer to that user.

How does this affect CloudFront pricing?

For the number of users, you’ll be charged:

  • CloudFront functions – $0.10 per 1 million invocations
  • Lambda@Edge – $0.60 per 1 million invocations

In the case of Lambda@Edge, you’ll be also charged for the actual time it takes to run your function at the cost of $0.00005001 for every GB per second.

Regional data transfer

What is this?

Regional data transfer refers to data transferred between edge locations and the origin server.

How does this affect CloudFront pricing?

The cost varies by region, as shown below:

  • United States, Mexico and Canada – $0.020 per GB
  • Europe and Israel – $0.020 per GB
  • South Africa, Kenya and Middle East – $0.060 per GB
  • South America – $0.125 per GB
  • Japan – $0.060 per GB
  • Australia and New Zealand – $0.080 per GB
  • Hong Kong, Indonesia, Philippines, Singapore, South Korea, Taiwan,
  • Thailand, Malaysia and Vietnam – $0.060 per GB
  • India – $0.160 per GB

The number of requests made

What is this?

Requests are split into user requests and origin requests.

User requests deliver the core functionality of CloudFront, in a sense. These are requests made by end users for content (images, video and static files).

Origin requests are made by CloudFront to the original source of the content when that content is not stored in its own cache or edge location. This means the S3 bucket or similar in which the content was originally stored.

CloudFront is of course designed to minimise origin requests.

How does this affect CloudFront pricing?

Both user and origin requests are charged at the same rate.

As of July 2023, you will be charged from $0.75 to $1.16 per 1 million requests.

Cache invalidation

What is this?

Cache invalidation refers to clearing content from a CloudFront server so it may be replaced by content from the origin server. The most common reason for this is to update old content. For instance, if you have updated your website’s images. 

When invalidating content, you are charged per URL path.

How does this affect CloudFront pricing?

You won’t be charged for your first 1,000 path invalidation requests per month, after which the cost rises to $0.005 per path.

Origin shield requests

What is this?

Origin shields help limit the number of requests to the original server in the event that content is not found at a user’s closest edge location.

Without an origin shield, a user might make a request for a piece of content; that content is then not found at the closest edge location; this means the content must be retrieved from the origin server.

An origin shield shields the origin server by looking for that same content from the next closest edge location, cutting down on latency.

How does this affect CloudFront pricing?

You are charged per 10,000 requests at the following rates per region:

  • United States – $0.0075 per GB
  • Europe – $0.0090 per GB
  • South America – $0.0160 per GB
  • Japan – $0.0090 per GB
  • Australia – $0.0090 per GB
  • Singapore – $0.0090 per GB
  • South Korea – $0.0090 per GB
  • India – $0.0090 per GB

Additional CloudFront features

What are these?

There are a number of lesser factors that affect the price of CloudFront. These are less likely to be relevant to all CloudFront users.

Real-time log requests

Real-time log requests provide information on how your users are interacting with CloudFront and your content. They’re primarily used to identify problems.

For every 1,000,000 log lines, you’ll be charged $0.01.

Field-level encryption requests

These provide additional encryption and security for data transfer than can be provided by the default HTTP requests.

If you were using Lamda@Functions to process payment, you’d likely use field-level encryption requests to keep that data transfer secure.

For every 10,000 requests, you’ll be charged $0.02.

Dedicated IP custom SSL

This is a specific or custom SSL certificate that might be required if, for instance, your content contained private healthcare information.

For every instance of these SSLs, you’ll be charged $600 per month.

How to reduce CloudFront costs

Luckily, we’ve done most of the hard work together.

Taking the time to understand CloudFront’s pricing is the first and most important step in learning how to reduce costs.

For example, you now know that you can leverage origin shields to cut costs, use class 100 pricing if you can tolerate a little latency – and which type of edge computing to use for running which type of code.

However, there are a number of other strategies you can use to not only reduce costs but also avoid the cloud resource waste that creates unnecessary carbon emissions.

Cache invalidation strategies

There are various strategies to reduce the cost of invalidating CloudFront caches.

By using URL query strings you can limit the amount of cache invalidations required.

For example, by appending?V=1 and ?V=2 to a URL, you gain more fine-grained control over your content.

Using AWS Cost Explorer and AWS Budgets

These tools can be used to track and analyse spending patterns in your CloudFront configurations.

This can help you identify problematic settings or activities and address your configuration accordingly.

Configuring your settings to minimise data transfer expenses

Within CloudFront, there are many options to set rules around file types and transfers which can be exploited to reduce costs.

How you approach this is up to you.

This is a great example of how the free tier can be valuable. You can experiment with the CloudFront UI to find the most efficient strategies for your workload.

How this saves a piece of the planet

Much of what cuts costs also cuts carbon.

Although we can’t claim every tactic from this guide will save the world, in general, cost reduction and carbon reduction go hand in hand.

If you’re looking to reduce your overall cloud bill (and save the planet) there are plenty of resources that can be turned off when not in use. 

And at Turn it Off, we’re committed to reducing unnecessary cloud carbon emissions generated by organisations. Our mission is to make the action of turning off cloud-based applications and resources easier than turning off your light switch at home. 

To learn more about how our AI-powered platform is cutting costs and carbon for organisations around the world, read our story.