Image Optimization in OpenCart: WebP, AVIF and Faster Loading

Image Optimization in OpenCart: WebP, AVIF and Faster Loading
If your OpenCart store page loads slowly, the culprit is almost always images. On a typical product page, images can account for 60-70% of the total page weight, far more than HTML, CSS or JavaScript. In Armenia, where most shoppers browse from a phone and often over mobile data, a heavy image translates directly into a lost sale.
Why speed is tied to sales and SEO
Every extra second of load time increases the chance a visitor bounces. Google also factors Core Web Vitals (especially LCP, the load time of the largest visible element) into rankings. Fast images improve both conversion and search position at the same time.
Step 1: correct dimensions
The most common mistake is uploading a 3000px-wide image where only 400px is ever displayed. The browser must download the whole file, then shrink it. Always upload an image at roughly the size it will be shown (doubled for Retina screens). OpenCart built-in image cache automatically generates resized versions in the image/cache/ folder, but if the original is huge, server load stays high.
Recommended dimensions
- Product thumbnail: 200-300px
- Main product image: 600-800px
- Banners/slider: no larger than the real display width
Step 2: compression
For JPEG, 75-85% quality is almost always visually indistinguishable from the original, yet cuts the file size in half or more. Use tools like TinyPNG, Squoosh, or server-side jpegoptim and optipng before uploading.
Step 3: convert to WebP and AVIF
WebP delivers 25-35% smaller files at the same quality as JPEG, and is supported by every modern browser. AVIF is even more efficient but slower to generate. The best approach is to serve WebP/AVIF to modern browsers and keep JPEG as a fallback via the <picture> element. In OpenCart 4 there are extensions (extensions/OCMOD) that automatically convert image-cache files to WebP.
WebP advantages
- 25-35% smaller files
- Supports transparency (like PNG)
- Faster LCP and better Core Web Vitals
Step 4: lazy loading
Add the loading='lazy' attribute to images that sit off-screen. The browser then downloads them only as the user scrolls near. Caution: the above-the-fold hero image should NOT be lazy, or your LCP will suffer.
Step 5: responsive images
Use the srcset and sizes attributes so a phone receives a small image while a desktop gets a large one. This matters especially for Armenia, where mobile traffic dominates.
Automation tools
Processing every image by hand is unrealistic for a large catalog. Consider bulk conversion with server-side cwebp, an OpenCart WebP/optimizer extension, or a CDN (such as Cloudflare Polish) that optimizes images on the fly without changing the originals.
Quick checklist
- Upload at correct dimensions
- Compress before uploading
- Serve WebP/AVIF
- Lazy load off-screen images
- Use srcset for mobile
Conclusion: Image optimization is the single most effective and affordable way to speed up OpenCart. Correct dimensions, compression, WebP and lazy loading, these four principles can halve your page weight, improve SEO and directly lift sales among Armenian shoppers.

