Image Optimization for WooCommerce: Four Decisions, Not One
Size, format, compression and lazy loading are separate decisions with different answers. Where a CDN helps, where it does not, and why the first image must not be lazy.
Most WooCommerce images are optimised badly, and it is rarely because the store owner ignored the problem. It is because “optimise images” hides four separate decisions that need different answers.
Decision 1: what size to serve
WooCommerce registers several image sizes and generates them on upload. The product page uses one, the archive grid uses another, the cart thumbnail uses a third. If your theme or page builder requests a size that was never generated, WordPress serves the closest larger one — often the 1200px original in a 300px slot.
Check it directly: open a product page, inspect the main image, and look at the file being served. If the URL ends in a filename without a size suffix, you are serving the original.
The fix is to register the sizes the design actually uses and regenerate thumbnails. Do not register fifteen sizes “just in case” — every size multiplies storage and regeneration time.
Decision 2: format
WebP is now safe to use broadly, and AVIF compresses better still, but neither is a migration task. Choose one of two approaches:
- Convert at the CDN — the origin keeps JPEG/PNG, the CDN serves WebP or AVIF based on the browser’s Accept header. Nothing in WordPress changes, and you can roll back instantly
- Convert in WordPress — a plugin generates WebP copies and rewrites references. More control, more places to break, and some page builders do not respect the rewritten references
For most stores, the CDN approach wins on risk. The exception is stores with no CDN, where the plugin approach is the only option.
Decision 3: how aggressive to compress
There is a real quality threshold and it is higher than most optimisers assume. Product photography for ecommerce can usually take quality 75–82 in WebP with no visible loss; below 65, fabric texture and fine detail start to smear, and customers notice on zoom.
The wrong optimisation is the one applied globally at the lowest setting to hit a benchmark. A homeware store selling linen and a store selling solid-colour phone cases do not need the same setting.
Decision 4: lazy loading, and where it hurts
Native lazy loading is on by default in WordPress for most images. It helps long category pages and hurts the element that should load first.
The rule: the main product image on a product page, and the first row of images on a category page, should load eagerly. Everything below the fold can be lazy. Getting this backwards produces a page that “loads” quickly in a test and feels slow to a customer, because the one image they came for arrives last.
The same applies to the hero image on the homepage. Lazy loading the largest contentful element is one of the most common causes of a poor LCP score — a specific failure covered in the Core Web Vitals guide.
CDN: what it does and does not fix
A CDN solves one problem: distance. If your server is in Germany and your customers are in Australia, a CDN serves images from nearby and removes several hundred milliseconds of latency per request.
It does not fix:
- Images that are too large — they are simply delivered faster from a closer place
- Slow server HTML generation — the CDN can cache it, but the first request still waits
- Too many requests — a CDN makes each one faster, not fewer
Where a CDN genuinely earns its cost for a WooCommerce store: multi-region customers, large catalogues with heavy imagery, and image resizing at the edge so you do not need to pre-generate every size.
The configuration that works
- Originals kept at 1600–2000px — enough for zoom and marketplaces
- Three or four generated sizes, matching the design, no more
- WebP at quality 78–82, delivered via CDN or plugin
- Featured product image eager, everything below the fold lazy
- Explicit width and height on every image, so the layout does not shift
- CDN in front if customers are far from the server
The last one is worth emphasising: images without width and height attributes are the most common cause of layout shift on product pages, and layout shift is measured directly as CLS. It is a one-line change per template with an outsized effect.
What to measure after
Test a category page and a product page as an anonymous visitor, from a location near your customers, and record:
- Total image bytes on the page
- The size and file type of the largest image
- The number of images loaded before the main content renders
If total image bytes did not drop meaningfully, the optimisation did not happen — you either converted files that were not being served, or the page is pulling originals somewhere.
For stores where images are half the page weight, this work is usually the highest-return performance change available, ahead of any caching or plugin work. If you want the image pipeline reviewed together with the rest of the stack, that falls under speed optimisation.