Wordpress LScache Plugin: Choose mix of lossy and lossless image optimisation
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, This is more like a future request. Would it be possible in future updates to include some kind of configuration option, that user can choose which images should optimise lossy and which ones lossless? For example, could do with RegEx where a user can define exceptions if the image name contains something then these images optimise lossless if the default settings are lossy? Our situation is that our website contains 40k+ images and a couple of thousands are for magazine use with textual content etc. for these images lossy optimisation is too much but for all other 90% website images lossy is perfect. Marking these images manually to use original file is very time-consuming. Or maybe you already have any suggestion how to set to use original image for a bunch of images in one go? Maybe option to add something in function.php file something like: if the image name contains something use the original image file? Or maybe if an image name contains something LiteSpeed server dont fetch these images at all and dont apply any optimisation. Thanks for building such a great plugin! This topic was modified 4 years, 4 months ago by Gints. We can add a hook for each image when send request. e.g. litespeed_if_lossless, passing the parameter $filename. Then you can control it in your functions.php with regex. Thank you! It would be great if can do something like that. If you could share the code snippet idea or just let me know when its possible to use the hook and I will figure it out. Thanks a lot for your support, its really worth to move hosting to LiteSpeed server. cheers. Please follow https://github.com/litespeedtech/lscache_wp/commit/d41567ee5d4f3fa8bf2c322439f9be432d27e711#diff-7e9626f9ede4283452ebda87e2f31667R591 That filter will be available in next release. This is amazing! Thank you for your support! If you dont mind, a review will be great!
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference