# DataFirefly Image Optimizer — WebP, AVIF, Compression and CDN for Shopware 6

> Native image optimization for Shopware 6.6 and 6.7. Automatic WebP and AVIF generation alongside every image, JPEG and PNG re-compression without visible quality loss, EXIF/ICC metadata stripping, transparent CDN URL rewriting (BunnyCDN, Cloudflare, KeyCDN, CloudFront). Picture tag, loading lazy, decoding async and width/height attributes auto-injected in the storefront for anti-CLS.

- Page: <https://www.datafirefly.com/en/product/dfimageoptimizer-en/>
- Language: en
- Last updated: 2026-06-29
- Platform: Shopware
- Category: SEO & Performance
- SKU: DF-IMGOPT
- Price: 59.00 EUR
- Other languages: [fr](https://www.datafirefly.com/product/dfimageoptimizer/index.md), [es](https://www.datafirefly.com/es/producto/dfimageoptimizer-es/index.md), [de](https://www.datafirefly.com/de/produkt/dfimageoptimizer-de/index.md), [it](https://www.datafirefly.com/it/product/dfimageoptimizer-it/index.md), [pl](https://www.datafirefly.com/pl/produkt/optymalizacja-obrazow-webp-avif-cdn-shopware/index.md), [nl](https://www.datafirefly.com/nl/product/dfimageoptimizer/index.md), [pt](https://www.datafirefly.com/pt/produto/dfimageoptimizer/index.md)
- Index: <https://www.datafirefly.com/en/product/llms.txt>

## Why this plugin

Images typically account for 50 to 70 percent of an e-commerce page's weight. Out of the box, Shopware 6 compresses JPEGs and generates multiple thumbnail sizes, but it produces neither WebP nor AVIF, and offers no native CDN integration. DataFirefly Image Optimizer fills that gap with a complete pipeline, triggered automatically on upload, that generates modern variants and rewrites URLs to your CDN.

## What it actually does

On every media upload, a subscriber listens to the media.written entity event, identifies JPEG, PNG and GIF files, and runs the optimization pipeline: progressive JPEG re-compression with 2x2/1x1/1x1 subsampling, or PNG re-compression with tuned compression level and filters; EXIF and ICC metadata stripping; WebP sibling generation with configurable quality; AVIF sibling generation with independent quality and a max-width safeguard. Shopware-generated thumbnails are processed too.

For images already in the library, a scheduled task runs by default every 15 minutes and processes pending batches, with configurable batch size. A button in the dashboard also lets you trigger a manual batch on demand.

## Smart CDN rewriting

The plugin rewrites URLs to your configured CDN, with three available scopes: media only, media plus thumbnails, or all static assets including theme and bundles. Compatible with all major CDN providers: BunnyCDN, KeyCDN, Cloudflare custom hostname, AWS CloudFront, Bunny Optimizer, or any in-house reverse proxy. When CDN is enabled, the plugin automatically injects dns-prefetch and preconnect tags in the storefront head to speed up DNS resolution.

## Modern storefront rendering

The thumbnail Twig component is extended via sw_extends to wrap the original image in a picture tag with AVIF then WebP sources then the original fallback. The browser automatically picks the lightest format it supports. The loading lazy, decoding async and width/height attributes for CLS prevention are injected based on configuration. A df_cdn Twig filter and a df_picture function are exposed to theme developers.

## Admin dashboard

A dedicated Vue 3 module under the Catalogues menu shows in real time the detected server capabilities: PHP version, Imagick presence, GD presence, effective WebP and AVIF support, recommended engine. Global stats show total image count, optimization coverage, WebP and AVIF counters, and most importantly the cumulative bytes saved. A 30-day activity table shows daily throughput.

## Server compatibility

The plugin uses Imagick by priority when available — higher encoding quality and the only way to get AVIF via libheif on older servers — then falls back to GD when Imagick is missing. AVIF needs either PHP 8.1+ with GD AVIF support compiled in, or Imagick with libheif. The dashboard immediately surfaces what's available on the server, avoiding surprises.

## Persisted data

A df_image_optimizer table tracks for each optimized media the presence of WebP and AVIF siblings, the compression status, the original size, and the cumulative bytes saved. A second df_image_optimizer_log table optionally keeps an error journal. The foreign key cascades from Shopware's media table cleans up orphan entries automatically when media is deleted.

## Compatibility

Shopware 6.6 and 6.7. PHP 8.2 and later. GD extension required, Imagick strongly recommended for AVIF encoding and superior WebP quality.
