Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a <link preload rel="image"> for each "critical" image (when using gatsby-image) #14043

Closed
KyleAMathews opened this issue May 15, 2019 · 3 comments

Comments

@KyleAMathews
Copy link
Contributor

KyleAMathews commented May 15, 2019

@baobabKoodaa noticed that critical images can be blocked on slower connections by loading JavaScript. We should prioritize loading critical images (and fonts) over loading JS as the above-the-fold content needs to be loaded before we worry about making it interactive.

One way to do that is when SSRing gatsby-image capture this and add some code to the <head> which can trigger the preloading.

The tricky part here is that the browser doesn't natively handle preloading/prefetching images that use srcset like gatsby-image does.

So we'd need to embed some code (as outlined in my RFC gatsbyjs/rfcs#35) that would take a srcset and pick the right image based on the browser screen size / resolution to preload.

@KyleAMathews
Copy link
Contributor Author

@lesagi
Copy link

lesagi commented Dec 20, 2020

Hi,
I've never contributed to open-source before, I'm eager to solve this issue - is it a To-Do task?
Is there someone to guide me through it?

@quansenB
Copy link

quansenB commented Jan 2, 2021

I would also like this being solved and would contribute. However I have no idea where in the code to look, so any hint would be great :)

@LekoArts LekoArts closed this as completed Mar 1, 2021
@gatsbyjs gatsbyjs locked and limited conversation to collaborators Mar 1, 2021
@LekoArts LekoArts removed the not stale label May 7, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants