Archived topic
Serving Device Specific Images
3 replies · Started by Ian on July 15, 2022
I am using GP Pro and GB Pro on this new site. When I run Pagespeed or Webpagetest, I see reports indicating that on mobile, the tests are serving smaller-sized images than on for desktop. Is GP, GB or Wordpress core now controlling this? I do have AVIF enabled through Shortpixel, not sure if this contributes to this behaviour. Any thoughts?
Hi Ian,
By default, WordPress controls the image sizes, not GeneratePress or GenerateBlocks.
In GenerateBlocks, you can set the Image size specific to a view, but the image size is only altered through CSS. The srcset or the image served should still be controlled by WordPress.
Hope this clarifies!
Thank you. Given that Wordpress does control this, I guess there is finally a use for the smaller media sets! By the way, when did this start happening? I was not aware of this and always thought you had to rely on a CDN to serve varying sizes. Thanks!
You’re welcome Ian!
It was added in WordPress 4.4. See here for reference: https://developer.wordpress.org/apis/handbook/responsive-images/
Hope this clarifies!