All our modules
Now showingWebP and AVIF Everywhere Settings Live demo
PrestaShop module · User guide

WebP and AVIF Everywhere — Documentation

WebP and AVIF Everywhere makes a WebP copy of every image your shop shows, and an AVIF copy where your server can create one, and sends each visitor’s browser the AVIF copy when it can show AVIF, otherwise the WebP copy, otherwise the original, at the image’s usual address. A copy is kept only when it is smaller than its original (by at least 5 % unless you change it). Your pages get lighter and load sooner, and nothing in your theme, your product feeds or your page cache has to change.

What WebP and AVIF Everywhere does

WebP and AVIF in two sentences

WebP and AVIF are modern image formats. The same photo is much smaller: WebP images are 25–35 % smaller than JPG at the same visual quality, and AVIF is often 20 % smaller than WebP. Almost every browser in use today shows WebP, and most show AVIF; the few others simply keep getting your JPG and PNG images.

Images are usually the heaviest part of a product or category page, so smaller images mean faster pages on phones and better scores in Google’s PageSpeed test, which asks for images “in next-gen formats”.

How it works

The module works in three steps, all of them visible on its settings page:

  1. Copies. For each JPG or PNG image, the module creates a WebP copy and, where your server can, an AVIF copy, saved next to the original. It does this for every size PrestaShop makes of your catalogue images, and for the images of CMS pages, your theme, the modules you choose and your shop logo. A copy is kept only when it is at least 5 % smaller than the original; you can change that share (Formats and quality).
  2. Delivery. The image keeps its .jpg or .png address. When a browser asks for it, your server answers with the AVIF copy if the browser accepts AVIF, with the WebP copy if it accepts WebP, and with the original otherwise. Where the server cannot do this, for example behind a CDN that keeps one version of each image, the module lists the copies in the HTML of your pages instead, and each browser picks the one it can show (Delivery).
  3. Automation and checks. New images are converted when you upload them, the others in the background. The Overview says first whether everything works, and lists what needs your attention with its fix; the header of every section repeats the answer in a few words (Overview: the answer and the checks).

What stays as it is

  • Your original images. The module only adds copies next to them. The one exception is the optional Optimise originals feature, off until you turn it on, which keeps a backup of every file it changes (Originals).
  • The image addresses. Your theme, your emails and other modules keep using the same .jpg and .png addresses.
  • Product feeds and shared links. Google Shopping, Facebook and other sites keep getting JPG images, and the delivery test checks that they do.
  • Page caches. The HTML of your pages is the same for every browser, so a page cache stays valid.
  • PrestaShop itself. Version 3.0 needs no override of PrestaShop’s code. Outside its own folders it changes one file, the shop’s .htaccess, where it writes a block of rules after a backup (Server rules). On PrestaShop 8.1 and later, where PrestaShop can make WebP and AVIF images of the catalogue itself, the module uses PrestaShop’s files and only adds what PrestaShop misses.

Where to find it

After installation the module has its own entry in the back-office menu: Design › WebP and AVIF images, at the end of the Design menu. The Configure button of the module in Modules › Module Manager opens the same page.

About this guide

  • The guide describes version 3.0 of the module. If you used version 2, read Upgrade from version 2 first: the settings page, the delivery and the cleanup work differently.
  • Labels are printed in bold exactly as the back office shows them, such as Convert now; Design › WebP and AVIF images is a menu path.
  • The chapters about the settings follow the menu of the settings page, from Overview to Help. If you are in a hurry, First setup in five steps takes you through the five setup steps.
  • Every setting also has a help button on the settings page with what it does and its default.

↑ Back to top

Requirements and compatibility

WebP and AVIF Everywhere runs on ordinary PrestaShop hosting. It needs no program installed on the server and no access to the command line: PHP’s own image tools are enough for WebP, and most recent hosts offer AVIF too.

At a glance

WhatNeeded
PrestaShop1.7.8.0 to 9.2 (the module accepts every PrestaShop 9 version). Tested on 1.7.8.11, 8.2, 9.0, 9.1 and 9.2.
PHP7.1 to 8.5
WebP copiesOne of: PHP’s GD extension with WebP (found on almost every host), Imagick with WebP, or an API key of the EWWW Image Optimizer cloud service (a paid service that makes WebP copies only).
AVIF copies (optional)GD with AVIF on PHP 8.1 or later, or Imagick with AVIF. Without either, your images get WebP copies only.
Web serverApache or LiteSpeed with a writable .htaccess file in the shop folder: the module writes its rules itself. nginx: you or your host paste the configuration the module shows. Tested on Apache 2.2 and 2.4, LiteSpeed, OpenLiteSpeed and nginx 1.18 to 1.30.
RecommendedPHP’s fileinfo extension (images are recognised from their header without it) and, on Apache, mod_headers, which sends the Vary: Accept header with the copies.
DatabaseThe one your PrestaShop runs on. Tested on MySQL 5.7 and 8.0 and MariaDB 10.6.
ThemesAny theme. Tested with Classic (PrestaShop 1.7.8, 8 and 9) and Hummingbird (1.0 and 2.x).
MultistoreYes, in every shop context (Multistore and permissions).
Back office languagesEnglish, French, Spanish, German, Italian, Polish and Romanian.

For some features

  • Automatic conversion in the background: a cron job of your hosting, or simply an employee with the back office open (Automatic conversion).
  • PageSpeed measurements: a shop that can be reached from the internet (Google measures it from outside).
  • Cloudflare purges and image variants: a Cloudflare API token (CDN).
  • Optimise originals: Imagick or GD, and free disk space for the backups (Originals).
  • The AI assistant tools: PrestaShop 9.2 (PrestaShop 9.2’s AI assistant).

Disk space

The copies are saved next to your images, so they take extra disk space. Each copy is smaller than its original, but with both WebP and AVIF on, the copies together can take about as much space as the originals. Statistics › Disk space shows how much space the copies take and how much is free (Disk space).

Not supported

  • PrestaShop 1.6 and 1.7.0 to 1.7.7: version 3.0 cannot be installed there; version 2 of the module keeps working on those shops.
  • JPEG XL, animated GIF and SVG images: they are left as they are.

↑ Back to top

Loading...
Back to top