/
/
CDN strategy for WordPress gallery sites

CDN strategy for WordPress gallery sites

6 min read

A gallery site serves more image bytes than almost any other kind. That is exactly the workload a CDN is built for — and where the wrong choice costs you.

A gallery site serves more image bytes than almost any other kind of WordPress site. A portfolio with a dozen galleries, a shop with a thousand product photos, a news site with image-heavy articles — these push image delivery far harder than a typical blog. That is precisely the workload a content delivery network is built for, which is why a CDN is closer to essential than optional for image-heavy sites. The catch is that the wrong CDN choice, or the wrong configuration, can cost more than it saves.

Here is how to think about CDNs for galleries. It pairs with our format guides on WebP and AVIF, because where you convert formats is part of the CDN decision.

Why gallery sites need a CDN more than most

Two reasons. First, distance: your server is in one place, your visitors are everywhere, and image bytes travelling halfway around the world are slow bytes. A CDN caches your images at edge locations near the visitor, cutting that distance. Second, volume: galleries serve a lot of large files, and offloading them to a CDN takes load off your origin server, which keeps the whole site responsive even under traffic. For an image-light blog these matter a little; for a gallery site they matter a lot.

What an image CDN actually does

Beyond caching, a modern image CDN can do work that directly improves your Core Web Vitals:

  • Edge caching — serves images from a location near the visitor.
  • On-the-fly resizing — generates the right size per device, so you do not ship a desktop image to a phone.
  • Format conversion — detects browser support and serves WebP or AVIF automatically, with fallbacks.
  • Compression — applies optimal compression at the edge.

The main options in 2026

Cloudflare

The most common starting point. Its free tier is genuinely useful for small-to-mid sites, with unlimited bandwidth and strong security included, and it is the easiest to set up (a DNS change rather than a plugin migration). The catch for galleries: Cloudflare’s automatic image optimisation — Polish, which compresses images and converts them to WebP and AVIF at the edge — is a paid feature, available on the Pro plan (around $25/month per zone as of 2026). So on the free tier you get caching and security and handle format conversion elsewhere (at your origin, via a plugin); on Pro, Cloudflare handles the format conversion too. Note that Cloudflare retired its older Mirage optimisation in late 2025, leaving Polish as the in-plan image path.

BunnyCDN

A popular choice for image-heavy sites because of pay-as-you-go pricing (around $0.01 per GB of bandwidth in North America and Europe) plus a dedicated image Optimizer add-on at a flat $9.50 per month with no per-image or per-transform limits. The pricing model often works out favourably at gallery scale. One important limitation to know: Bunny’s Optimizer converts to WebP but, as of 2026, does not support AVIF — the company has been public about this, citing AVIF’s slow encoding (in their testing some images took close to a minute to process) as the reason they prioritised WebP. So if AVIF specifically matters to you, Bunny’s optimiser is not the route; if WebP is enough (and for most sites it is), the price-to-performance is hard to beat.

Server-level vs CDN-level optimisation

You can optimise images at your origin (a plugin or server process converts and stores WebP/AVIF) or at the CDN edge (conversion happens on the fly per request). Origin optimisation is predictable and works with any CDN, including a plain caching one. Edge optimisation means no stored duplicates and automatic per-browser format selection, but ties that logic to your CDN provider. Many gallery sites do origin-level format conversion and use the CDN purely for fast delivery — simpler, and not locked to one vendor.

Do this now. Decide where format conversion happens before you pick a CDN. If your gallery plugin or an image plugin already converts to WebP/AVIF at the origin, you only need the CDN for fast delivery — and a free-tier caching CDN is enough. If you want the CDN to do conversion too, choose one whose image features cover the formats you need, and confirm AVIF support if that matters to you.

Setting up a CDN with WordPress

The general pattern, regardless of provider: point the CDN at your site (via DNS for a full-proxy CDN like Cloudflare, or via a plugin that rewrites image URLs to the CDN domain for a pull-zone CDN like Bunny), configure caching rules for images (long cache lifetimes, since image files rarely change), and verify in the browser Network tab that images now load from the CDN domain. Then re-test Core Web Vitals to confirm the improvement.

A worked setup: the typical path

To make the general pattern concrete, here is the route most gallery sites actually take. You already have an image-optimisation or gallery plugin converting images to WebP at the origin, so format conversion is handled — you just need fast delivery. You sign up for a CDN, point it at your site (a DNS change for a full-proxy CDN, or install the provider’s plugin for a pull-zone CDN), and set image cache lifetimes long, since image files rarely change once published. You then open a gallery page in your browser’s Network tab and confirm the images now load from the CDN’s domain rather than your own. Finally, you re-run PageSpeed Insights from a couple of locations and confirm the image-delivery times have dropped, especially for visitors far from your origin server. That is the whole job for most sites — an afternoon, much of it waiting for DNS to propagate.

The two things that trip people up: forgetting to set long cache lifetimes (so the CDN keeps re-fetching from your origin, defeating the point), and not verifying in the Network tab (so they assume it is working when a misconfiguration means images are still served from the origin). Both are caught in five minutes by actually looking at where the images load from.

Cost modelling for a gallery site

The variable is bandwidth, and galleries use a lot. A flat-fee or generous-free-tier model is predictable; a per-gigabyte model can be cheaper at low volume but scales with traffic. Model it against your actual image bandwidth (your host’s stats will show this), and remember that converting to WebP/AVIF first reduces the bytes the CDN serves — so format optimisation and CDN cost are linked. Smaller images mean a smaller CDN bill.

That link is worth designing around: the less each image weighs before it reaches the CDN, the less the CDN costs and the faster it delivers. Converting gallery images to modern formats at the origin — which FotoGrids Pro Plus does automatically, WebP and AVIF with fallbacks — means the CDN is shipping already-optimised files, so you get the delivery speed of the CDN and the byte savings of modern formats together.

Key takeaways

  • Gallery sites serve heavy image bytes — a CDN is closer to essential than optional.
  • Decide where format conversion happens (origin vs edge) before choosing a CDN.
  • Cloudflare is easiest to start with; Bunny suits image-heavy pay-as-you-go — verify current features.
  • Converting to WebP/AVIF first shrinks both load time and your CDN bill.

Does a gallery site need a CDN?

For an image-heavy site, close to yes. Galleries serve far more image bytes than a typical blog, and a CDN caches those images near your visitors and offloads them from your origin server — improving load times and keeping the site responsive under traffic. For an image-light blog the benefit is smaller.

Should the CDN or my server convert images to WebP/AVIF?

Either works. Origin conversion (a plugin or server process) is predictable and works with any CDN, with no vendor lock-in. Edge conversion happens on the fly at the CDN with automatic per-browser format selection, but ties that logic to the provider. Many gallery sites convert at the origin and use the CDN purely for delivery.

Cloudflare or BunnyCDN for a gallery?

Cloudflare is the easiest to start with and has a useful free tier, though its automatic image optimisation is on paid plans. BunnyCDN suits image-heavy sites with pay-as-you-go pricing and an image optimiser add-on. Confirm current pricing and format support (including AVIF) before committing, as these change over time.

FotoGrids · Pro Plus

Automatic WebP & AVIF, with fallbacks.

Convert every gallery image to modern formats automatically, with JPG/PNG fallbacks for older browsers. Smaller files, faster pages, no manual export step.

  • Automatic WebP and AVIF conversion.
  • Fallbacks for older browsers.
  • Up to 70% smaller files [PLACEHOLDER].

In this article

Share the article
Related Articles