CDN for images

Cache public images near readers. Request the size and format each layout needs and invalidate the affected variants when you replace a source file.

Responsive image delivery
Source
/media/catalogue-chair.jpg
Listing rendition
480 px · WebP
Detail rendition
1280 px · AVIF

Deliver responsive variants from a source image

Cache images at Cloud CDN and convert, resize and crop at delivery time. Keep a single source file. Serve WebP or AVIF where the client supports them.

WebP and AVIF without a second pipeline

Request WebP or AVIF at an appropriate width and compare the result with the original at the intended display size.

Cache derived images

A cached variant can answer another request for the same dimensions and format.

Query-string variants

Resize and crop through query strings instead of baking every breakpoint into storage.

Configuration

Cloud CDN overview
  1. Point the media hostname at Cloud CDN

    Pull the existing image origin — CMS uploads, a files host or an app disk.

  2. Enable transformation

    Convert to WebP or AVIF and resize from URL parameters.

  3. Set a lifetime for each variant

    Immutable image URLs can use long TTLs. Purge when a source file is replaced.

  4. Cut over the media domain

    Map TLS and DNS once variants look correct on a test hostname.

Operational outcomes

  • Repeated requests for the same image variant can share a cached response
  • Source files stay untransformed at origin
  • WebP and AVIF can be negotiated at the edge
  • Replaced files can be purged by URL

Frequently asked questions

Do I need to store WebP and JPEG?

No. Keep a high-quality source and convert at delivery time. You can still store more than one format if you already do.

Can I crop for product cards versus heroes?

Yes. Use query-string resize and crop per layout instead of separate originals.

What happens when an image is updated?

Purge the URL or directory. Versioned filenames avoid purge entirely.

Does this work with WordPress and Magento media?

Yes. See CDN for WordPress, WooCommerce and Magento for CMS-specific notes.