Wordpress LScache Plugin: Image optimization breaks with custom media URL
Last Updated on: Wed, 15 Apr 2026 00:00:02 We have a separate subdomain for media set up in wp-admin/options-media.php like this: Media save folder: wp-content/uploads Full URL to media: https:// uploads.example.com So our media is served at uploads.example.com/2021/05/media.jpg.webp However LS Cache does not recognise those URLs as internal so it doesnt replace any of the media used with the WebP versions. I looked trough the source code of the plugin and tried adding define(LITESPEED_FRONTEND_HOST, uploads.example.com) but it tried to look for the media at uploads.example.com/wp-content/uploads/2021/05/media.jpg.webp which is obviously wrong. [Util] external [Media] -no file, bypassed [Media] webp replacing: uploads.example.com/2021/05/media.jpg => LiteSpeed Media->replace_webp(uploads.example.com/2021/05/media.jpg)@851 => LiteSpeed Media->webp_srcset(ARRAY)@835 => WP_Hook->apply_filters(ARRAY,ARRAY)@289 => wp-includes/media.php@212 The page I need help with: https://suomimobiili.fi/oneplus-9r-puhelimesta-julkaistiin-tyylikas-vihrea-variversio-kiinassa/ Hi, please try go to CDN -> set CDN URL to https://uploads.example.com/ , then set origin URL to //uploads.example.com/ do NOT miss the / before and after Best regards, Hi, Finally got around to try this plugin again. But no, this does not work. Log says its trying to find the file from wrong place: 08/03/21 21:44:27.027 [80.223.122.92:55096 1 bFH] [Util] file not exist: /mnt/web/html/2021/08/magic-3-1-300x160.png 08/03/21 21:44:27.027 [80.223.122.92:55096 1 bFH] [Media] -no file, bypassed The file is still in the original place at /mnt/web/html/wp-content/images/2021/08/magic-3-1-300?160.png.webp
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference