Image bytes dominate the payload of a typical WordPress page — a hero image alone is often larger than all the HTML, CSS, and JS combined. Converting to WebP cuts that by 25–35%, AVIF by 50%, and modern browsers handle the negotiation automatically. On a LiteSpeed-enabled cPanel host, LSCache + QUIC.cloud will do the conversion and the storage of optimized copies without changing the WordPress media library. We use this on most WP customers because it works without code changes.
What’s happening
The LSCache plugin queues media library images to QUIC.cloud for optimization. The remote service produces WebP and AVIF variants, sends them back, and stores them next to the original. On request, LiteSpeed inspects the Accept header and serves the best variant the browser supports — WebP/AVIF for modern clients, the original JPEG/PNG as a fallback. No code change, no plugin rewriting <img> tags, no media library disruption.
The alternative without QUIC.cloud: a server-side converter (cwebp, avifenc) run on upload, paired with rewrite rules that pick the right variant based on Accept. More work, no external dependency, more CPU on the origin.
How to verify
From outside the cPanel host, request the same image with different Accept headers:
curl -I -H "Accept: image/webp,image/*" https://example.com/wp-content/uploads/2024/03/hero.jpg
curl -I -H "Accept: image/avif,image/*" https://example.com/wp-content/uploads/2024/03/hero.jpg
curl -I https://example.com/wp-content/uploads/2024/03/hero.jpg
The first should return content-type: image/webp, the second image/avif, and the third image/jpeg. If all three return the original JPEG, the optimization layer is not engaged.
On the cPanel host, check the LSCache plugin queue status:
cd /home/<user>/public_html
wp litespeed-purge all
wp option get litespeed.conf.media-webp_replace
The fix
- In the LSCache plugin > Image Optimization, request optimization. The first run sends every media library image to QUIC.cloud; for a large site this can take a day. Subsequent uploads are processed within minutes.
- Enable “WebP Replacement” and, if your audience tilts modern, “AVIF Replacement”. The plugin handles the
Acceptnegotiation in.htaccessrewrites that LiteSpeed honors. - Set “Image Quality” to 82 for WebP, 75 for AVIF. Below 70 you start seeing artifacts on photos.
- For sites that do not use LiteSpeed: install
webpandlibaviffrom the EPEL repo, write an upload hook to convert on save, and addmod_rewriterules that pick the variant based onHTTP_ACCEPT.
Once variants are being served, the next bottleneck is usually the <img> markup not specifying srcset for responsive sizes — that is a theme issue, not a server issue. Stack Harbor configures image optimization as part of WHM server management.