Skip to content

Image Optimizer (WebP/AVIF & Lazy Load)

Add-on ID: kv_image_optimizer_webp · Edition: CS-Cart & Multi-Vendor · Latest version: 1.0.0 · Compatible with: CS-Cart & Multi-Vendor 4.17.2 – 4.21.x, PHP 7.4 – 8.3 · Changelog: view

Images are usually most of the bytes of a store page. Image Optimizer (WebP/AVIF & Lazy Load) creates WebP and AVIF copies of your product, category and banner images and their thumbnails, serves them to every browser that supports them, and keeps the original as the fallback. It adds native lazy loading below the top of the page and gives the main product image priority, so pages load faster and score better in Core Web Vitals. The originals stay untouched unless you switch on the optional compression, which backs every original up first.

  • WebP and AVIF copies of thumbnails, product and category images, banners and other store images, made with PHP only (GD or Imagick). No external programs, no exec(), no cloud service.
  • Safe delivery: a <picture> element with AVIF and WebP sources and the original image as the fallback. The page markup is the same for every visitor, so it works with the CS-Cart 4.21 full page cache and any CDN.
  • Smaller is the rule: a copy is only used when it is smaller than the original; stale copies of replaced images are never shown.
  • Native lazy loading and LCP priority: loading="lazy" for images further down the page, never for the logo, the first images and the home page banner; fetchpriority="high" for the main product image.
  • Bulk optimisation in the background: a cron command, an “Optimise now” button with a progress bar, and short background batches while you work in the admin panel. Storefront requests never wait for an image to be converted.
  • Compress originals (optional): JPEG originals at a quality you choose, PNG originals losslessly, metadata removed. Every original is backed up and comes back with Restore originals.
  • Savings report: images found and optimised, bytes saved per format and per image group, a searchable files list with the reason for every skipped file, and per-file exclude or optimise again.
  • Server check: the admin page shows which formats your server can write. Missing AVIF or Imagick support is detected and the add-on uses what is there.

Image optimizer: images found, optimised, bytes saved, progress, savings per format and image group, server support

Page Contents
Installation Requirements, installing, the first run, upgrading, uninstalling
Configuration Every setting, server support, CDN and storage, license
Usage The image optimizer page, cron, the files list, restore and maintenance, what visitors get
Developer notes How copies are stored and served, hooks, full page cache, data model, file map
FAQ Common questions
  • CS-Cart and CS-Cart Multi-Vendor 4.17.2 – 4.21.x (tested on CS-Cart Ultimate 4.17.2, Multi-Vendor 4.17.2 and Multi-Vendor 4.21.2, including the 4.21 full page cache).
  • PHP 7.2.5 – 8.3, depending on your CS-Cart version, with the GD extension (required by CS-Cart). WebP needs GD with WebP support or Imagick; AVIF needs PHP 8.1+ with AVIF in GD, or Imagick with AVIF.
  • Themes: Responsive, Bright and Nova (4.21), and themes based on them: the add-on works on the core image template that all of them use.
  • Images on the server’s file system, also behind a CDN. Images stored on Amazon S3 are not supported.