How to exclude GIF image from being cached by Jetpack CDN

[ad_1]

I’m using Jetpack Site Accelerator, but it looks like some big size GIF image (over 4MB) is broken.

I tried the code below to ‘exclude’ .gif file, however it doesn’t work. When I check with Chrome DevTools the img src still pointed to CDN url (i0.wp.com, i1.wp.com, …)

​

function exclude_gif_jp ( $val, $src, $tag ) {
$img_file = parse_url($src, PHP_URL_PATH);
if ( $img_file !== false && strrpos( $img_file, “.gif”) !== false ) {
return true;
}
return $val;
}
add_filter( ‘jetpack_photon_skip_image’, exclude_gif_jp 10, 3 );

Is there any other way?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer