- This topic has 6 replies, 2 voices, and was last updated 2 years, 3 months ago by Tom.
April 5, 2019 at 10:33 am #860786Rizki Alief Irfany
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.GeneratePress 2.2.2GP Premium 1.7.8April 5, 2019 at 4:09 pm #860977TomLead DeveloperLead Developer
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?April 5, 2019 at 6:40 pm #861020Rizki Alief Irfany
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.April 5, 2019 at 6:50 pm #861024Rizki Alief Irfany
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.April 6, 2019 at 8:49 am #861462TomLead DeveloperLead Developer
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' );April 6, 2019 at 9:01 am #861468Rizki Alief Irfany
Amazing 😀 It works Tom. Big thanks for you.
But may I know, what is the “srcset” function ? Is srcset only in GP ?April 6, 2019 at 4:00 pm #861634TomLead DeveloperLead Developer
Glad I could help 🙂
srcset is a core WordPress thing. It makes it so different image sizes are served to different screen sizes.
- You must be logged in to reply to this topic.