Wordpress LScache Plugin: Problem with the images in the ESI widget
Last Updated on: Wed, 15 Apr 2026 00:00:02 I have activated the option in Litespeed Cache so that the images load in webp when the header accepts it, the problem is that when the widgets are ESI the images do not load in webp, I imagine that the optimization of images does not work when it is an ESI block. Could it be a bug? o Why is this happening? Has anyone else had this problem? Yes, your guess is correct. Loading webp images in ESI is currently not supported. And there is no snippet that can solve this, for example, if the header accepts webp, add .webp at the end of urls that dont have it? Hi, this is known issue that ESI sub-request will bypass all the optimization features it is on our to-do plan if you are not using any CDN service , you can add this into your .htaccess as workaround RewriteCond % HTTP_ACCEPT image/webp RewriteCond % REQUEST_FILENAME .webp -f RewriteRule ^(. ).(jpg|jpeg|png|gif) $1.$2.webp [T=image/webp,L] this rule will force to load webp when browser supports and file exists, despite the URI will remain unchange, but the format will be webp Best regards, Yes I use CDN, so it does not work for me, but thanks for trying, surely someone who does not use CDN will do. Hi, okay , certain CDN like BunnyCDN can have webp vary support , which is also compatible with this ruleset , for you info Best regards, Thanks a lot!Yes now!When he told me that, I have gotten into KeyCDN and activated Cache Key WebP, then in Litespeed cache I deactivated creating webp versions, I activated it again and now the images, although they do not end with webp, are the webp versions, with the same size and in the response header puts content-type: image / webp. Thanks a lot
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference