CTW Image Optimizer – automatic WebP conversion
The module creates lightweight WebP copies of every shop image and serves them to browsers that support them. Image URLs, the theme and the originals stay untouched, and the dashboard shows exactly how many megabytes you save.
About the module
Images are usually the largest part of every shop page. PrestaShop generates thumbnails as JPG and PNG, while WebP at the same visual quality is typically 25–70% smaller. Less data means faster loading on phones, better Core Web Vitals and less server bandwidth.
CTW Image Optimizer creates a WebP copy next to every image (e.g. 1-home_default.jpg.webp) and delivers it to browsers that support WebP. Everyone else gets the original. It does not change image URLs or theme templates, never overwrites originals, and runs on PrestaShop 1.7 through 9.x.
How it works
- Install the module. WebP serving rules are added to img/.htaccess automatically.
- Click “Scan and optimize”. Images are processed in batches with a progress bar.
- Use “Test on a product image” to confirm the browser really receives WebP.
- Set up the cron task (URL or command line, both shown in the panel) so new thumbnails, categories and imports are optimized automatically.
- New product images are converted right after upload.
Who it's for
- Shops with many product images where PageSpeed reports “Serve images in next-gen formats”.
- Shops on PrestaShop 1.7, which has no built-in WebP support.
- Shops on shared hosting: processing runs in short batches and a megapixel limit protects against running out of memory.
- Agencies that want to speed up client shops quickly without touching the theme.
What this module is not
It does not resize images or regenerate thumbnails. It does not create AVIF, add lazy loading or rewrite URLs to a CDN. On nginx-only servers (without Apache) the serving rules must be added manually; a ready configuration snippet is in the panel.
What it solves
-
Heavy images slow the shop down
JPG and PNG thumbnails are usually most of the data downloaded on every visit, especially on product lists and the home page.
-
PageSpeed asks for next-gen image formats
Google PageSpeed Insights flags “Serve images in next-gen formats”, and converting thousands of files by hand is not an option.
-
PrestaShop 1.7 has no WebP support
Many shops still run 1.7, where WebP is not available at all, and replacing the theme just for image formats is too costly.
-
Optimization that breaks URLs and themes
Many solutions change image URLs or templates, which risks errors in the theme, other modules and product feeds.
-
No idea what it actually gains
Without numbers it is hard to tell whether optimization works and how much bandwidth it saves.
Key features
-
Before and after statistics
Image size before optimization, after it, megabytes saved and the average WebP gain in percent. A results table for each image type: products, categories, brands, suppliers, stores, CMS images, and logo and shop images.
-
Image URLs and theme unchanged
WebP copies are stored next to the originals, and img/.htaccess rules serve them to browsers that send Accept: image/webp. Older browsers get the original, and the Vary: Accept header keeps caches and CDNs from mixing them up.
-
One-click serving test
“Test on a product image” requests a real thumbnail and confirms the server returns Content-Type: image/webp, so you know right away whether the rules work on your server.
-
New images converted immediately
Product images are converted to WebP right after upload and thumbnail generation. Everything else, such as categories, brands, regenerated thumbnails and imports, is handled by cron.
-
Cron via URL or CLI
A ready token-protected cron URL and a command-line command to copy from the panel, with the time of the last run. Processing runs in batches and resumes where it stopped.
-
Quality and safety controls
WebP quality slider (default 80), image type selection, Imagick or GD engine picked automatically, keeping the original when WebP would be larger, and a megapixel limit that protects servers with low memory limits.
-
Originals are never modified
The module only adds .webp files. When you delete an image, category, brand or supplier, its WebP copies are removed too, and uninstalling removes the module's rules from img/.htaccess.
-
Maintenance tools
Re-optimize all images (e.g. after changing quality), retry failed images, and delete all WebP files with one click.
-
PrestaShop 1.7–9.x, Apache and nginx
Runs on PHP 5.6–8.4. For nginx-only servers the panel shows a ready configuration snippet.
Frequently asked questions
Which PrestaShop versions are supported?
PrestaShop 1.7 through 9.x, on PHP 5.6 to 8.4.
Does the module modify my original images?
No. It creates a separate .webp file next to each image. Originals stay untouched, and all WebP files can be deleted with one button.
Do I need to change my theme?
No. Image URLs do not change. The server delivers the WebP file to browsers that support it.
What about browsers without WebP support?
They receive the original JPG or PNG. The module sends a Vary: Accept header, so caches and CDNs do not mix up the versions.
Does it work on nginx?
On Apache, and on nginx as a proxy in front of Apache, it works out of the box. On nginx alone, add the snippet shown in the module panel to the server configuration.
How much will I save?
It depends on your images. On the PrestaShop demo catalog (1,046 images) the size dropped from 8.97 MB to 2.84 MB, i.e. by 68%. The panel shows the exact numbers for your shop after the first scan.
Will it cope with shared hosting?
Yes. Conversion runs in short batches via cron, and images above the configured megapixel limit are skipped to stay within the PHP memory limit.
What does the license include?
A one-time purchase for one production domain, unlimited test domains, and 12 months of updates and support. After that the module keeps working, just without new versions.
Compatibility and terms
- Compatibility
- PS 1.7 – 9.x
- PHP
- 5.6+
- PrestaShop
- 1.7 – 9.x
- PHP
- 5.6 – 8.4
- Engine
- Imagick or GD
- Server
- Apache (.htaccess) or nginx
- Support
- 12 months
- License type
- One-time purchase, 1 domain, 12 months of updates
- Built for
- PrestaShop 1.7–9.x shops, agencies
Changelog
1.0.3
- First release on modules.codetheweb.pl.