Chrome downloads all preload variants

Created on 22 November 2023, 11 months ago
Updated 11 July 2024, 3 months ago

Has anyone else seen this issue?

Problem/Motivation

The Google Chrome browser seems to download all image preload variants regardless of media query.

These articles talk about this.
https://medium.com/@francis.john/viewport-and-media-query-based-preloadi...
https://www.bronco.co.uk/our-ideas/using-relpreload-for-responsive-images/

Possible reasons:
Google Chrome's look ahead parser does not wait for the device-width to be set.

Steps to reproduce

  • Enable the module. Configure an image field in a content type using the RIP module.
  • Open Chrome dev tools and look at the images in the waterfall under the network tab.

Proposed resolution

Make sure the viewport metatag is above the image preload HTML tags in the HEAD tag.

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Set min-width and max-width in the media breakpoints in the media query.

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jrabeemer

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024