• Resolved Mat Gargano

    (@matstars)


    Hi there,

    If I want to use the generated webp’s in CSS (background image) or PHP where I’m either outputting a string of the URL of the webp to preload, for example. Is there an easy way to do so?

    M

Viewing 1 replies (of 1 total)
  • Plugin Author WP Media

    (@wp_media)

    Hi @matstars

    The main problem with this approach is how to determine browsers that do not support WebP and deliver the fallback image for these.

    That’s the reason we do not apply it as we are not sure about the best way to handle it.

    At this moment, the best way to implement WebP to background images is to use rewrite rules method (which does not work with Cloudflare/CDN so it’s another downside).

    Hope this helps at least a bit, although I understand I didn’t provide a clear guidance.

    Let me know what you think.

    Best Regards
    Marko

Viewing 1 replies (of 1 total)

The topic ‘Using generated webp’s in PHP/CSS’ is closed to new replies.