Keeping cloud egress costs under control

Published 2026-11-06

The cost nobody budgets

Compute and storage prices are on the front page of every pricing table. Data transfer out of the cloud, to the internet or across regions, is easier to miss and grows with success. A chatty API, a large unoptimised image or a dashboard polling every second all turn into a line on the invoice.

Reduce what you send

  • Compress text responses with gzip or brotli.
  • Set cache headers so browsers and CDNs do not re-fetch unchanged files.
  • Serve images in modern formats at the size they are displayed.
  • Paginate and filter on the server instead of shipping whole tables.

Prefer pushing to polling

A page that asks the server for status every few seconds creates traffic whether or not anything changed. Webhooks, server-sent events or longer intervals with conditional requests send data only when it matters. If you must poll, return a tiny response and use an ETag, so an unchanged answer costs a few bytes.

Put a cache in front

A CDN absorbs repeat requests at the edge, so your origin sends a file once and the network serves it many times. Static assets with hashed filenames can be cached for a year. For dynamic pages, even a short cache on public content cuts origin traffic sharply.

Mind the architecture

Traffic between services in different regions or availability zones can be billed, while traffic inside the same zone often is not. Keep chatty components together, and be careful when a design moves large payloads between hosts or out to the internet. Before shipping a feature that moves a lot of data, estimate the volume and say so, rather than finding out on the next bill.

Set budgets and billing alerts at a level where a surprise reaches you in days, not at the end of the month.

Finding the real sources

Before optimising, measure. Cloud providers can break traffic down by service, region and direction, and the biggest line is rarely the one you guess. Typical culprits are large images or videos served straight from the origin, API responses that return far more fields than the client uses, backups and logs shipped across regions, and polling loops left running in forgotten browser tabs.

Look at the top few contributors and ask of each: does this need to leave the network at all, can it be smaller, can it be cached, and can it be sent less often.

Practical habits

  • Set a billing alert well below the number that would hurt, so a surprise becomes an email and not an invoice.
  • Serve static assets through a CDN with long cache lifetimes and versioned file names.
  • Paginate lists and return only the fields a screen needs.
  • Keep chatty services in the same region, and send backups to storage in the region they come from.
  • Review the bill monthly for ten minutes; trends show up before they become problems.

Design for it early

Egress is easier to control at design time than after launch. Decide where media is stored and how it is delivered, prefer events over polling for live status, and treat any feature that moves large payloads across the internet as a cost decision as well as a technical one. A small platform with predictable traffic can stay predictable if the architecture respects the meter.

© 2026 The Good Fellas