• Hi. I have a problem: if the wp rocket plugin is enabled, then the images are still PNG. If you turn it off, then WEBP.

    How can I fix this error ?

Viewing 1 replies (of 1 total)
  • you are probably using:

    • Replace image URLs?
    • Only do the replacements in webp enabled browsers

    Try instead using

    • Replace <img> tags with <picture> tags, adding the webp to srcset.?
    • Dynamically load picturefill.js on older browsers

    This is the only option you can use safely with caching plugins as per info provided next to the 1st option you are probably using: Does not work with page caching – unless you are using the Cache Enabler plugin

    Hope that helps.

    PS

    If after activating the <picture> option your website looks broken, than I’m afraid it needs your developer attention, as again, as per info provided: Beware that this structural change may break styling!

    So if that’s the case, your developer will need to resolve this issue as the current styling is not compatible with the change you just activated. Alternatively you can choose to pay for a CDN that will deliver webp images without any change to the page structure. It can cost as little as $3 per 100GB per month so its dirt cheap.

    • This reply was modified 2 years, 9 months ago by robaczek1.
Viewing 1 replies (of 1 total)

The topic ‘Image replacement does not work when WP Rocket is enabled’ is closed to new replies.