Fix the CDN missing images for your SSL site

If you ever find such a problem that not all of you files get uploaded in CDN. You know you can migrate images but it takes some time there is not a full surety that all images will be uploaded to CDN.

So If you put a CDN link like

will not found missing images.

Using a CURL to know your missing images is the worst Idea Ever.  CURL is a server end process and You can check this on client END too. The Idea is to check the error images and replace it with your server directory, which is your base site director not a CDN.

So missing images will be coming from your serer and CDN images will be coming from CDN

Follow the below code and Have fun

function fix_cdn_url(){
$(“img”).error(function () {
var source = $(this).attr(‘src’).replace(‘’,’’);
$(this).unbind(“error”).attr(“src”, source);
}); }



Leave a Comment