Skip to content
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

Preloading a hero image for LCP #29

Open
anton-karlovskiy opened this issue Jan 25, 2021 · 1 comment
Open

Preloading a hero image for LCP #29

anton-karlovskiy opened this issue Jan 25, 2021 · 1 comment
Assignees

Comments

@anton-karlovskiy
Copy link
Member

anton-karlovskiy commented Jan 25, 2021

Re: #25 (comment), #25 (comment)

Hi @pi0 @atinux @danielroe cc @addyosmani
On the home page, there is a hero image which is detected as an LCP element.
Although the hero image is dynamic (randomly picked up), since we're using Nuxt.js (SSR), I think we can write a dynamic script using JS which is to be rendered first on the server-side and hydrated as a plain script (no dynamic part included) to the client.
Is there any package or approach in Vue/Nuxt to preload it?

Manual approaches:
https://web.dev/preload-responsive-images/
https://addyosmani.com/blog/preload-hero-images/

@pi0
Copy link
Member

pi0 commented Jan 26, 2021

Related feature request (nuxt/image#105). We should support it via <nuxt-img preload> soon (so automatically injects <preload> to head)

@pi0 pi0 mentioned this issue Feb 16, 2021
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants