Site logo

Archived topic

Photon Image CDN Issue

6 replies · Started by Rizki on April 5, 2019

Viewing posts 1–7 of 7

Hi there,

I use image CDN from here : https://bit.ly/2Uzyca7 for my 2 sites with different theme. The 1st use GP ( listed in the site url ) and the 2nd use other theme ( page sample : https://bit.ly/2uNfsVU ).

When I open these 2 sites and check the source code ( ctrl + u ) i see all image url have changed to https://i0.wp.com/domain.com/wp-content/uploads/:image-directory. It means that CDN works normally.

But when I open these 2 sites and open some image in new tab, my GP's site bring up image with original url. When I open new tab image from my 2nd site ( page sample : https://bit.ly/2uNfsVU ), it bring up image with CDN url. Shouldn't it be like this ?

Why is it different ? You can try it yourself to better understand my point.

Hi there,

I'm not familiar with how Photon works, but I don't see why GP would be any different as it doesn't do anything fancy/different when it comes to adding images.

Can you link me to a page using GP? How are you opening the image in a new tab?

Have you tried with the actual Photon feature in Jetpack?

Hi Tom,

I also think so. Even I use same plugin list in my 2 sites, so there should be no difference.

My GP site : https://aliefirfany.com. You can try open any image on that site using right click >> open in new tab. Image opened with original url. Compare with my 2nd site : https://bit.ly/2uNfsVU with other theme, image opened with cdn url when I click right open in new tab.

I've tried Jetpack, the results are same.

Hi Tom,

I have another example. This is my GP site : https://bit.ly/2UyMV4Z. And my 2nd site use Twenty Nineteen : https://bit.ly/2ORtU8z. Try right click and open any image in new tab on both my sites. See the difference of image url.

fyi, the 2 sites just installed, so there hasn't been any changes.

It looks like images that are using srcset aren't working with your PhotonCDN code.

You can disable srcset to test:

add_filter( 'wp_calculate_image_srcset', '__return_false' );

Amazing :D It works Tom. Big thanks for you.

But may I know, what is the "srcset" function ? Is srcset only in GP ?

Glad I could help :)

srcset is a core WordPress thing. It makes it so different image sizes are served to different screen sizes.

This archived topic is closed to new replies.