Image Optimization
smoxy automatically optimizes images served through your site — reducing file sizes without visible quality loss and converting images to modern formats like WebP and AVIF. This improves page load times and reduces bandwidth usage.
How It Works
When image optimization is enabled:
A visitor requests an image (e.g.,
product.jpg)smoxy fetches the image from your origin
smoxy compresses the image and optionally converts it to WebP or AVIF
The optimized image is cached and served to the visitor
The original URL does not change — format negotiation happens automatically via the
Acceptheader
Supported input formats: JPEG, PNG
Supported output formats: JPEG, PNG, WebP, AVIF
Enabling Image Optimization
Navigate to your Site in smoxy
Open the Image Optimization settings
Toggle Image Optimization on
Configure quality and format settings
Save
Format Conversion
Convert to WebP
When enabled, smoxy converts JPEG and PNG images to WebP format for browsers that support it. WebP typically achieves 25–35% smaller file sizes compared to JPEG at the same visual quality.
convert_to_webp
Enabled
webp_quality
75
Browsers that do not support WebP receive the optimized original format (JPEG or PNG).
Convert to AVIF
When enabled, smoxy converts JPEG and PNG images to AVIF format for browsers that support it. AVIF typically achieves even better compression than WebP.
convert_to_avif
Enabled
avif_quality
50
Browsers that do not support AVIF fall back to WebP (if enabled), or the optimized original format.
Note: Some services like Google Merchant Center do not accept AVIF images. If you use Google Merchant feeds, see Google Merchant Crawler for details.
Quality Settings
Image optimization uses a quality range (min/max) to find the best balance between file size and visual quality. smoxy uses the SSIM (Structural Similarity Index) method to ensure compressed images remain visually identical to the originals.
JPEG
jpeg_quality_min
1–100
40
Minimum acceptable quality (lower bound)
jpeg_quality_max
1–100
98
Maximum quality (upper bound)
jpeg_quality_target
0.0001–0.9999
0.9997
SSIM target — higher means closer to the original
The SSIM target controls how aggressively smoxy compresses. The default of 0.9997 is very conservative — nearly indistinguishable from the original. Lower the target for smaller files at the cost of slightly reduced quality.
PNG
png_quality_min
1–100
40
Minimum acceptable quality
png_quality_max
1–100
98
Maximum quality
WebP
webp_quality
1–100
75
Output quality for WebP conversion
AVIF
avif_quality
1–100
50
Output quality for AVIF conversion
Per-Request Overrides
You can override image optimization settings for specific requests using Conditional Rules. This allows you to:
Set different quality levels for mobile users
Disable format conversion for specific paths
Apply more aggressive compression for specific regions
Example: Reduce image quality for mobile visitors to save bandwidth:
User Agent matches (Mobile|Android|iPhone)
JPEG Max Quality
75
User Agent matches (Mobile|Android|iPhone)
WebP Quality
65
Important Considerations
Automatic format negotiation: smoxy checks the visitor's
Acceptheader to determine which formats the browser supports. The URL stays the same — only the response format changes.Cached per format: Optimized images are cached separately for each output format. A JPEG, WebP, and AVIF version of the same image can coexist in the cache.
Only JPEG and PNG inputs: smoxy optimizes JPEG and PNG images. Other formats (GIF, SVG, etc.) are passed through without modification.
Lossless is not supported: Image optimization always applies lossy compression. If you need pixel-perfect image delivery, disable optimization for those paths using a Conditional Rule.
Cloudflare users: If you use Cloudflare in front of smoxy, disable Cloudflare's image optimization (Polish) to avoid double optimization. See Cloudflare Setup.
Last updated
Was this helpful?