Critical CSS not generating right image urls




Wordpress LScache Plugin: Critical CSS not generating right image urls

Last Updated on: Wed, 15 Apr 2026 00:00:02
I have a small issue regarding Critical CSS. The generated Critical CSS rules contain the wrong urls to background images. The generated rules background urls are pointing to a path, relatively to the page url instead of the site main url. Example: My CSS: header.site-header #video-bg-wrapper .video-item .thevideo-img-replacement background: url(/wp-content/themes/my-theme/img/v2/header-new.jpg) Generated by Litespeed/CCSS: header.site-header #video-bg-wrapper .video-item .thevideo-img-replacement background: url(wp-content/themes/my-theme/img/v2/header-new.jpg) The CSS rule generated by Litespeed has a missing / before wp-content. So on all other pages than the homepage the image is pointing to a URL relative to its page url. So if im visiting https://www.my-website.com/my-example-page . The image is trying to load an image on (which is throwing a 404): https://www.my-website.com/my-example-page/wp-content/themes/my-theme/img/v2/header-new.jpg instead of https://www.my-website.com/wp-content/themes/my-theme/img/v2/header-new.jpg Which plugin version you are using? I tried on v3.3. Didnt seem to meet this issue. Im running 3.3 as well (most recent version). Hi, We couldnt reproduce this issue. Could you please join our Slack community for further investigation ? Please let me know your username if youd join. Best regards, Tried debugging it myself. Created a staging environment of the same website en tried to reproduce the issue there. I couldnt -). I requested a new domain key on the original website. After this, the CCSS rules are generated as it should. Dont know what it caused, but it seems to be fixed now. Also worth to mention, the right CSS rules for background images have a quote around the path: background: url(/wp-content/themes/my-theme/img/v2/header-new.jpg) The wrong urls didnt had quotes around the path: background: url(wp-content/themes/my-theme/img/v2/header-new.jpg) Noted. Thanks.



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



Reference