Skip to content

PoC for preloading responsive images for blocks#2322

Draft
Osong-Michael wants to merge 1 commit intomainfrom
poc-preloading-images
Draft

PoC for preloading responsive images for blocks#2322
Osong-Michael wants to merge 1 commit intomainfrom
poc-preloading-images

Conversation

@Osong-Michael
Copy link
Contributor

@Osong-Michael Osong-Michael commented Jul 15, 2024

Ref: PoC for Preloading big images (eg. Carousel Header, Page Header pattern) while using imagesrcset.

Some implementations propose using <link rel="preload" as="image" href="images/example-medium.jpg" media="(max-width: 1023px)">, while others suggest replacing the media with a sizes attribute instead.

Testing

If you disable caching on the Network tab and enable 3G, then you reload the page there are two visible scenarios

  • The first case, which is the normal way our websites currently load is, you see the images load at the same time the page shows, so for a split second the Carousel Header has an empty image.
  • Second case, with the current implementation, when you reload the page, the first image in the Carousel Header block is being pre-loaded as the page loads, meaning by the time the page becomes visible, the image is present.

This implementation is good for blocks or scenarios where we control what images are being displayed.

@Osong-Michael Osong-Michael added the PoC Pull requests that are defined as a proof of concept label Jul 15, 2024
@Osong-Michael Osong-Michael self-assigned this Jul 15, 2024
@Osong-Michael Osong-Michael marked this pull request as draft July 15, 2024 09:31
planet-4 added a commit to greenpeace/planet4-test-umbriel that referenced this pull request Jul 15, 2024
/unhold b99353a7-ba97-43e8-84f9-0ef937b31f73
@planet-4
Copy link
Contributor

Test instance is ready 🚀

🌑 umbriel | admin | blocks report | CircleCI | composer-local.json

⌚ 2024.07.15 09:41:10

planet-4 added a commit to greenpeace/planet4-test-umbriel that referenced this pull request Jan 29, 2025
/unhold 89d298db-1b8f-44a6-a8ee-2a8eaaa03967
planet-4 added a commit to greenpeace/planet4-test-umbriel that referenced this pull request Feb 3, 2025
/unhold ccbbdb1d-8116-4c32-8ce4-25f20c250135
planet-4 added a commit to greenpeace/planet4-test-umbriel that referenced this pull request Feb 3, 2025
/unhold 4d207b46-9169-419c-8ce7-a8c3a1e7e5bb
- Testing out the functionality using the Carousel Block
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PoC Pull requests that are defined as a proof of concept

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants