• Resolved sunnyt13

    (@sunnyt13)


    Hey there,

    I’m using Oxygen builder, and I have background images set for some of my sections. The output is very regular:

    #mysection {
    background-image: url(domain.com/image.jpg);
    }

    However, even though I have webp versions of those images, and “Image WebP Replacement” set to On, they’re not getting replaced.

    Does LSCache support WebP images that are within CSS?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Sadly no , currently LSCWP only supports webp in HTML code

    You can add this rule into .htaccess

    RewriteCond %{HTTP_ACCEPT} "image/webp"
    RewriteCond %{REQUEST_FILENAME}.webp -f
    RewriteRule ^(.*).(jpg|jpeg|png|gif) $1.$2.webp [T=image/webp,L]

    to force it load webp if webp exists and browser supports

    the URI will remain unchanged, but under the hood it will be using webp format.

    and if you are using any CDN service, please do check if your CDN can properly vary the image

    Best regards,

Viewing 1 replies (of 1 total)
  • The topic ‘WebP for background images?’ is closed to new replies.