Learn about Centmin Mod LEMP Stack today
Register Now

Wordpress Wordpress cached images issue

Discussion in 'Blogs & CMS usage' started by iaTa, Mar 2, 2019.

  1. iaTa

    iaTa Member

    32
    6
    8
    Mar 26, 2018
    Ratings:
    +6
    Local Time:
    3:35 PM
    I have a problem with images sometimes rendering far larger than they should. I've checked the code and when an image loads correctly I see this:
    HTML:
    <img class="preload-me lazy-load is-loaded" src="https://site.co.uk/wp-content/uploads/2017/07/x61wKIUHA-yL._SL1500_-60x60.jpg.pagespeed.ic.QQA7eGmZLu.webp" alt="" style="will-change: auto;" srcset="https://site.co.uk/wp-content/uploads/2017/07/61wKIUHA-yL._SL1500_-60x60.jpg 60w, https://site.co.uk/wp-content/uploads/2017/07/61wKIUHA-yL._SL1500_-120x120.jpg 120w" width="60" height="60">
    After a few page refreshes an image may be rendered far too large and the code shows the following:
    Code:
    <img class="preload-me lazy-load is-loaded" src="data:image/webp;base64,UklGRoIBAABXRUJQVlA4IHYBAABQCACdASo8ADwAPpFCm0glpCKhLhbZyLASCWkACwBHOhENY/HQ0DHwDhiHknH+RiY9o0O+8/MljEzbH6DGmVqoucJLmzfCmOYPDwAA/vshnwNvL/C+N+esUpDmFWiAEmn8L7+nvkkjoyJJExgMZz5LGqMwE620vYhF9v7L6wntSqR83zLf+lRpnYXmSoLK2u5dc3tgpTlOns4hgHBBuqhCyXnYhFUk0YqZErqJV2W5+FYKh/2W6Vavc/BBIVxpz+95ayhRe9NOHqjsNHdBtnsk2i0qlBfb5fzmSUFMMgBjzq+92OYZLnavfbjgjIlUk7VHi/Mnq6SxPhm/bx2UeXJlId6JSdT8KpmnxZziPkSm3j9Y8UbtBXumwgH9eN7te/7IZtnNUl5TWPrlfWDbNlAV73Q9w9A7IIiBf4TH2jQATqv9cHkFfDm+I2iqsS42foVfd29wXiX5lF61zjzmwwQkThqrp5hYnfDe6PFeL41DNDrVmHAAAA==" alt="" data-pagespeed-url-hash="1322903256" onload="pagespeed.CriticalImages.checkImageForCriticality(this);" style="will-change: auto;" srcset="https://site.co.uk/wp-content/uploads/2017/07/61wKIUHA-yL._SL1500_-60x60.jpg 60w, https://site.co.uk/wp-content/uploads/2017/07/61wKIUHA-yL._SL1500_-120x120.jpg 120w">
    Any ideas what could be causing this issue, maybe pagespeed?

    custom_config.inc:
    Code:
    NGXDYNAMIC_NGXPAGESPEED='y'
    NGINX_PAGESPEED='y'
    PHP_PGO='y'
    PHP_PGO_CENTOSSIX='y'
    LETSENCRYPT_DETECT='y'
    VHOSTCTRL_CLOUDFLAREINC='y'
    NGXDYNAMIC_BROTLI='y'
    NGINX_LIBBROTLI='y'
    NGINX_HPACK='y'
    NGINX_DYNAMICTLS='y'
    CLOUDFLARE_ZLIBPHP='y'
    CLOUDFLARE_PATCHSSL='y'
    OPENSSLECDSA_PATCH='y'
    OPENSSLECDHX_PATCH='y'
    MARCH_TARGETNATIVE='y'
    ENABLE_MARIADBTENTWOUPGRADE='y'
    ENABLE_MARIADBTENTHREEUPGRADE='y'
    pagespeed.conf: https://gist.githubusercontent.com/...60e39e8c1b0290ed40c7144503320e/pagespeed.conf
     
    Last edited: Mar 2, 2019
  2. eva2000

    eva2000 Administrator Staff Member

    40,625
    9,017
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,884
    Local Time:
    12:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    that is ngx_pagespeed converting images to data uris which should be be done for small sized images by default
     
  3. iaTa

    iaTa Member

    32
    6
    8
    Mar 26, 2018
    Ratings:
    +6
    Local Time:
    3:35 PM
    Do you know why some of these small thumbnail images sometimes get rendered massively over size when they have been converted to these data uris?

    For example this should be a tiny thumbnail next to the latest blog post listed in the footer: Capture

    This is happening on multiple different sites on the same server.
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. eva2000

    eva2000 Administrator Staff Member

    40,625
    9,017
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,884
    Local Time:
    12:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    some images just do.. so you can just setup a exclude filter in pagespeed.conf for specific image urls
     
  5. iaTa

    iaTa Member

    32
    6
    8
    Mar 26, 2018
    Ratings:
    +6
    Local Time:
    3:35 PM
    Can I just disable that feature of ngx_pagespeed?
     
  6. eva2000

    eva2000 Administrator Staff Member

    40,625
    9,017
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,884
    Local Time:
    12:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1
  7. iaTa

    iaTa Member

    32
    6
    8
    Mar 26, 2018
    Ratings:
    +6
    Local Time:
    3:35 PM
    Sorted, thank you.
     
    • Like Like x 1