• Hi,

    I use Imagify image optimizer Plugin to compress images when uploading to media library on the fly. Even though the images are compressed before I preview the (new) post, the uncompressed version of the image which I initially uploaded, is used by the CDN.

    Is there a way to fix this?

    https://www.ads-software.com/plugins/cdn-enabler/

Viewing 6 replies - 1 through 6 (of 6 total)
  • The CDN enabler plugin simply rewrites the assets URLs, so that should not be happening. Are you uploading thumbnails, or are these full images you are referring to?

    Is there an example somewhere you could share?

    Thread Starter Bloggd

    (@rameshmvp)

    Brian,

    I’m uploading PNG files using the Media Library, and Imagify optimizes it as I upload the files. After I craft a post and preview it, the images URLs are rewritten correctly, but the CDN copy has the versions of files that are uncompressed or unoptimized (the ones I initially uploaded).

    I’m saying this after comparing the files in the CDN link with the optimized one in the server. I’ve to open the KeyCDN dashboard and purge the image URL every time.

    Thread Starter Bloggd

    (@rameshmvp)

    I’ll update this post after doing a bit more testing in all angles to rule out any caching issues here. Request to keep this thread open for 1 more day.

    Thanks.

    Thread Starter Bloggd

    (@rameshmvp)

    I can repro this every time I make a new post. Here is my most recent post.

    Image from CDN (46 KB)
    Image from original server (20 KB)

    This is the procedure I use:

    Create a New post > click “Attach file” > Upload the image (it automatically is optimized) > Save the post and Preview it.

    I haven’t tried this way though:

    First, upload the image via Media Library > Create a New post > Insert the image from library > Save the post and Preview it.

    So I got some time to test this myself. If you clear cache on the CDN or purge that individual image you are testing I think you will see that the smaller optimized version now shows up.

    Images cache on the CDN after 2 requests hit the image. So most likely what is happening is that even when you are in preview mode, you are actually hitting it enough to force it to cache on CDN.

    I don’t advise clearing cache on CDN too often, but clearing it once in a while would fix this issue.

    Hopefully that helps. Thanks!

    Thread Starter Bloggd

    (@rameshmvp)

    Brian, Think you’re correct about the requests. But I’m wondering if there is a filter I can add for CDN Enabler to skip rewriting the assets URL when in preview mode (“?preview=true”)

    When I upload an image, it goes to Imagify’s servers, it does the reprocessing and sends back the file. So, that’s the first hit. Second hit is when I preview the post, but it’s only after I optimized the image. That’s what stumps me.

    Only possibility I can think of is Imagify is doing 2 requests per file (for some reason) triggering the CDN to cache it.

    For now, I’m optimizing the images offline and then uploading it.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Image Optimization Plugin vs CDN Enabler’ is closed to new replies.