Disable responsive images needed
-
The following has to be added after the test for WP version:
// Disable responsive images because the dynamic images don't show as attachments so aren't cached. add_filter( 'wp_calculate_image_srcset_meta', '__return_null' );
Two years ago, WP 4.4 added a responsive images feature which automatically emits images in several sizes (look for srcset in the HTML). Those images don’t exist in the Media Library and aren’t detected as attachments, so they are not cached. That line of code disables the responsive images.
- The topic ‘Disable responsive images needed’ is closed to new replies.