CSS background-image not being replaced




Wordpress LScache Plugin: CSS background-image not being replaced

Last Updated on: Wed, 15 Apr 2026 00:00:02
Hi there, I have a slight issue with the replacement of CSS background-images. As you can see in this screenshot, the first background-image (which is disabled) gets replaced, the second one, which is the one being displayed hasnt been replaced. I have added the CSS class .page-hero to the WebP Attribute To Replace list in the LSC settings. Any help is much appreciated, thanks! Hi, the code for that part is preg_match_all( #background -image:( s )url ((. ) )#iU, $this->content, $matches ) if you look at your screenshot , the first background image will match , but second doesnt because there is some string linear-gradient ? in between so failed will advice our devs to add detection in such case. Best regards, Thanks for the prompt reply! For the moment Ive disabled the overlay and made the area behind the text itself darker so that the WebP image is used.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference