Images don’t load when Smush CDN is enabled

When I enable Smush CDN images doesn’t load, and there is multiple console error for Smush CDN images URL stating 429. When I disbale Smush CDN images load fine

  • Adam Czajczyk
    • Support Gorilla

    Hi Larry

    I hope you’re well today and thank you for contacting us!

    The 429 HTTP status (error) is “rate limiting” related and doesn’t really mean that the CDN doesn’t work but that the CDN wasn’t able to fetch given image from its original location.

    To be able to serve image from CDN Smush must first be able to put it there. If a CDN is not able to fetch such image too many times, it will result in it giving 429 error.

    Some of the common reasons for that are

    – the original image doesn’t exist or original URL is invalid (so 404 on original URL) – not a case here
    – invalid file type (e.g. it’s not an image) – not a case here too
    – too large or corrupt image file – doesn’t seem to be the case here too
    – a firewall or other security/request limiting tool/filter blocking requests

    I think we might be dealing with the latter here. I see that firewall in WordFence is currently disabled but I’m not sure if there’s any firewall on a server itself and I also see that CloudFlare seems to be quite strict as even when I tried to visit the site it “stopped me” for a while for “DDoS protection check”.

    Could you try putting CloudFlare in “dev” mode or pausing it entirely (just temporarily, for testing) to see if CDN starts to work for your site then?

    Let me know about results, please, and we’ll then see what to do next to fix it permanently while keeping CloudFlare up and running.

    Best regards,
    Adam

  • Larry
    • WPMU DEV Initiate

    Hello Adam,
    Thank you for investigating.
    I have another website with virtually the same configuration, with attack mode on at CloudFlare, and was not having this issue. The one difference is I have Wordfence installed on the covid19refusers website, so, I deactivated it. That did not solve the problem.

    Then, I disabled the DDoS attack mode in CloudFlare – that fixed it. Your CDN works.

    I tried a few more configurations, and even went back into attack mode on Cloudflare and your CDN still worked.

    The only conclusion I can come to is this:

    Something occurred when I uploaded the logo image to my website while in attack mode at Cloudflare – somehow having that on AND the CDN on caused a hiccup.

    My other website has zero image issues when in attack mode and with the CDN on.

    Perhaps this is a caching issue of some sort since Cloudflare also serves images from cache. It’s a little over my head though.

    So, while I am developing my website and adding images, I’ll be sure to have attack mode off in Cloudflare.

    We can close this ticket and thank you for helping me troubleshoot this issue.

    Larry

  • Larry
    • WPMU DEV Initiate

    I could not send a support request and I could not initiate a live chat!!! So, I am posting here:

    So, I have Smush Pro and the CDN on two websites. One is n development (cover-19refusers) and one is functioning / operational (medicalfreedompatriots). I use CloudFlare. I had put “attack mode” on in Cloudflare on both sites a few days ago.

    Medicalfreedompatriots operated normally. Images loaded. No issues.

    But, covid19refusers stopped loading images once I turned on the CDN. It seemed as though the issue was related to me uploading a new image *while* I attack mode (DDoS protection) because after some troubleshooting, I got everything to work.

    TODAY, I went to my medicalfreedompatriots website and noticed that the images were NOT loading. I turned off attack mode. Did not fix it. I turned off CDN – that fixed it. I put Cloudflare into BYPASS mode and turned CDN back on. DOES NOT WORK.

    So, now, even with Cloudflare bypassed, the CDN will not load images onto my website.

    I’m paying $14 a month for this service. If it is not going to work I’ll cancel my monthly payment.

    Do you have any ideas what is going on?

    Thank you,

    Larry

  • Adam Czajczyk
    • Support Gorilla

    Hello Larry

    Thank you for responses and I’m sorry for delayed answer!

    Let me start with the “covid19refusers” site as it was the one the issue was reported initially.

    We have done some more tests and the “attack mode” is, indeed, the cause of the problem as it’s breaking communication with Smush CDN. To be specific – in some cases it doesn’t allow CDN to update/fetch images from the site.

    If you change and image or new images are added etc – those images must first be fetched to CDN and if CloudFlare blocks it, they won’t be. But then Smush CDN can’t know that so it still updates (on the fly, that’s not permanent change) image URLs and that causes the images to disappear.

    However, Smush CDN is caching images so even in “attack mode” – as long as these images are in cache they will work. If cache expires (so they need to be “re-fetched”:wink: or the given image is not in cache yet, an error happens.

    Therefore, it is possible that on some site you won’t notice any difference with- or without “attack mode” and everything will work fine – if all images are cached, no images were changed on site and no new ones added.

    We can’t, at least for now, “interact” with CloudFlare’s “attack mode” to make is “pass through” the Smush CDN requests but I’ve asked our developers to look into it. I’m not much familiar with CloudFlare’s API but we’ll look into it to see if it’s possible to “bypass”/override it in some way directly from Smush plugin.

    As for “medicalfreedompatriots” site. The site requires login and there’s currently no support access granted to it so I can’t check it. If it’s affected by the issue, would you please enable support access to it via “WPMU DEV -> Support -> Support Access” page -> “Grant support access” button there?

    I’d like to check those CDN images there too. Note please: it’s also possible that the CDN stopped working due to a temporary API issue on our end that happened just recently (please keep an eye on this status page) – normally it would automatically “restart” but if the CloufFlare’s “under attack mode” was “in a way” it might have been not able to re-connect to CDN properly (due to same reasons as issue with “covid19refusers” site images).

    Kind regards,
    Adam

  • Larry
    • WPMU DEV Initiate

    Thank you for getting back to me Adam.

    Perhaps there were just a lot of things happening at once.

    I purged the cache in Cloudflare, put Cloudflare in maintenance mode (cache bypass), and turned on the CDN in the medicalfreedompatriots website, and all worked. I then turned off maintenance mode on Cloudflare and the CDN still works on that website.

    I did the same on the covid19 website and all is working.

    So, it appears that your CDN has issues with attack mode (DDoS protection) from Cloudflare, and I’ll use it sparingly – only if a website is under attack.

    Thank you for your help,

    Larry