AWS Builder Center
The Great Cloud Egress Escape: Why Your Cloud Bill Gives You Nightmares

The Great Cloud Egress Escape: Why Your Cloud Bill Gives You Nightmares

Cloud transfer cost follows the complete path, not just the destination. Compare CDN delivery, cache behavior, compression, and network processing without inventing a universal savings figure.

You can reduce your compute bill and still watch the total grow because the same response crosses a paid network boundary over and over.
I think of data transfer like a delivery route with tolls. Counting the final distance isn't enough if the route also crosses a bridge, a tunnel, and a regional boundary. In AWS, the relevant boundaries may include the internet, Regions, Availability Zones, or a network-processing service. The analogy is about identifying each meter, not claiming that every boundary is charged the same way.
Before adding a CDN or moving a workload, I'd draw the route one request actually takes.
This is an updated adaptation of  my original article . The old dollar examples were illustrative; this version uses explicit assumptions and links to current pricing instead. References were reviewed on November 8, 2026.

Start with bytes and the path they follow

Write down the source, destination, service, protocol, approximate response size, request count, and intermediaries. Include the return path. Then map each segment to its billing rule.
Same-Region does not automatically mean free. Network processing and some cross-AZ paths can still matter. Internet delivery, cross-Region replication, and private connectivity are different products with different billing models. Compare them using the workload's actual route rather than one generic egress rate.
A useful cost worksheet separates:
transfer charges
+ network-processing charges
+ request charges
+ origin compute and storage requests
+ optional delivery/security features
Not every architecture incurs every line. The point is to keep a reduction in one line from hiding an increase in another.

What a CDN changes

For cacheable content, a CDN can reduce the requests and bytes that reach the origin. It can also improve delivery latency. That doesn't mean every byte served from the edge is free, or that a cache hit avoids the viewer-delivery meter under pay-as-you-go pricing.
For a simplified example, assume viewers download 1,000 GB in a month and 90% of those bytes are cache hits. Ignoring revalidation and other overhead, the origin supplies about 100 GB. Viewers still receive 1,000 GB. Those are different quantities to price.
CloudFront currently offers both pay-as-you-go and flat-rate plans. Compare the relevant  CloudFront pricing  rather than carrying forward a fixed dollars-per-TB claim from an old example.
AWS documents free transfer from supported AWS origins such as S3, ALB, and API Gateway to CloudFront. Flat-rate plans bundle specified delivery and security capabilities, with plan allowances and configuration constraints. Those details can change the comparison materially. Check the  plan documentation .
I'd compare the complete monthly bill for the intended traffic mix, including requests and optional features. Origin offload is valuable, but it isn't itself the savings calculation.

Cache according to the content's contract

Versioned static assets are usually easier to cache for long periods: publish a new filename when the content changes. HTML and API responses need freshness and authorization decisions that fit their callers.
Cookies, headers, and query strings included in a cache key can fragment the cache. Removing a field without understanding what it changes can be worse: different users may receive a response intended for someone else.
Choose the smallest cache key that still separates meaningfully different responses. For personalized content, establish the isolation model before optimizing the hit ratio. Test both freshness and user separation.
A year-long TTL also doesn't imply that every edge location fetches an object exactly once per year. Caches have their own populations, eviction behavior, and demand. Measure origin requests rather than deriving them from TTL alone.

Send fewer bytes before buying a different route

Reducing response fields, returning an aggregate, compressing suitable content, and avoiding repeated downloads can improve every downstream meter at once.
Here's a standalone file-compression example, adapted from the original article:
import gzip
import shutil

def compress_file(input_file, output_file):
with open(input_file, "rb") as source:
with gzip.open(output_file, "wb") as destination:
shutil.copyfileobj(source, destination)
This writes a gzip file. It does not configure HTTP content negotiation, Content-Encoding headers, or CDN compression. Those belong to the serving path. Measure the compressed output: already-compressed media may gain little, and CPU work isn't free.
Similarly, resizing a compute instance doesn't inherently reduce the number of bytes transferred. DataSync can help with transfer workflows, but using a transfer tool is not a universal discount on the underlying network charges.

Verify the change against business work

Choose a representative period and compare delivered bytes, origin bytes, request volume, error rate, latency, and total cost per completed business operation.
If the bill falls because fewer legitimate requests succeed, that is not an optimization. If the cache hit ratio rises while stale responses increase, the trade-off needs a product decision.
I would revisit the architecture when traffic geography, response size, cacheability, or delivery-plan eligibility changes. A CDN that makes sense for one workload can have different economics for another.

Conclusion

Trace the bytes, identify each meter, and compare the whole route. Use caching and compression where the response contract permits them, then confirm the result in the bill and the user-visible behavior.
The useful outcome is a defensible cost per delivered operation. A dramatic savings percentage without a traffic model doesn't tell us whether the next month's architecture will be cheaper.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article