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

Improve Largest Contentful Paint (LCP) #4765

Open
preschian opened this issue Jan 19, 2023 · 15 comments
Open

Improve Largest Contentful Paint (LCP) #4765

preschian opened this issue Jan 19, 2023 · 15 comments
Labels
A-maintenance p3 non-core, affecting less than 40%

Comments

@preschian
Copy link
Member

LCP: https://web.dev/lcp/

how to check LCP on chrome devtools:

  1. switch to Slow 3G network under Network tabs in chrome devtools
  2. click reload button under Performance tabs
  3. hover LCP in timings section to see the content

Screenshot 2023-01-19 at 08 48 19

this is our LCP score on the homepage in the previous 21 days

Screenshot 2023-01-19 at 08 56 49

dash cloudflare com_b3f9fdfd827152316d080a5ddee59915_web-analytics_overview_web-vitals_siteTag_in=38fe89ac254b4f6d93554e9673ca7734 path=%2F time-window=30240

@exezbcz
Copy link
Member

exezbcz commented Jan 19, 2023

thought it was going to be a problem, the svgs are quite large. Is there anything I can change?

@preschian
Copy link
Member Author

thought it was going to be a problem, the svgs are quite large. Is there anything I can change?

hhmm 🤔 I guess nothing wrong with the svgs stuff, maybe we can tackle this from code. let's ask the other first

maybe it's possible with just CSS. unfortunately, I'm not really good with CSS
cc @roiLeo @Jarsen136 @prachi00 is it possible to use CSS for that gradient stuff?

@exezbcz
Copy link
Member

exezbcz commented Jan 19, 2023

thought it was going to be a problem, the svgs are quite large. Is there anything I can change?

hhmm 🤔 I guess nothing wrong with the svgs stuff, maybe we can tackle this from code. let's ask the other first

maybe it's possible with just CSS. unfortunately, I'm not really good with CSS cc @roiLeo @Jarsen136 @prachi00 is it possible to use CSS for that gradient stuff?

i think that would be the best approach, but it would have to match pretty closely :D svgs are generally not meant to be exported with effects on top. The effects should be applied in css afterwards

@exezbcz
Copy link
Member

exezbcz commented Jan 19, 2023

in the end its just this:
image
with applied blur on top.
filter: blur(200px);

@roiLeo
Copy link
Contributor

roiLeo commented Jan 19, 2023

thought it was going to be a problem, the svgs are quite large. Is there anything I can change?

we can try to:

  • reduce svg size or change file format (webp?)
  • async loading with nuxt-img

is it possible to use CSS for that gradient stuff?

not sure it's the best option

@Jarsen136
Copy link
Contributor

thought it was going to be a problem, the svgs are quite large. Is there anything I can change?

hhmm 🤔 I guess nothing wrong with the svgs stuff, maybe we can tackle this from code. let's ask the other first

maybe it's possible with just CSS. unfortunately, I'm not really good with CSS cc @roiLeo @Jarsen136 @prachi00 is it possible to use CSS for that gradient stuff?

IMO, we could try to inline the svg file to the js/html, to avoid fetch too many pic while open landing page. They cost a lot time at the network fetching.
image

is it possible to use CSS for that gradient stuff?

It may be not that easy to match the design with css.

@Jarsen136
Copy link
Contributor

👋
I would take it a try.

@Jarsen136 Jarsen136 self-assigned this Jan 19, 2023
@kodabot
Copy link
Collaborator

kodabot commented Jan 19, 2023

ASSIGNED - @Jarsen136 🔒 LOCKED -> Saturday, January 21st 2023, 04:26:52 UTC -> 36 hours

@exezbcz
Copy link
Member

exezbcz commented Jan 19, 2023

👋 I would take it a try.

nice, ping me if anything

@preschian
Copy link
Member Author

IMO, we could try to inline the svg file to the js/html

oohh, yes, this may help to improve that 🚀🚀🚀

@kodabot
Copy link
Collaborator

kodabot commented Jan 21, 2023

ASSIGNMENT EXPIRED - @Jarsen136 has been unassigned.

@Jarsen136
Copy link
Contributor

Jarsen136 commented Jan 22, 2023

thought it was going to be a problem, the svgs are quite large. Is there anything I can change?

hhmm 🤔 I guess nothing wrong with the svgs stuff, maybe we can tackle this from code. let's ask the other first
maybe it's possible with just CSS. unfortunately, I'm not really good with CSS cc @roiLeo @Jarsen136 @prachi00 is it possible to use CSS for that gradient stuff?

IMO, we could try to inline the svg file to the js/html, to avoid fetch too many pic while open landing page. They cost a lot time at the network fetching.

I would close this PR #4780 (inline svg file) for two reasons:

  1. Though inlining svg would reduce some image network request, it also increase the size of js bundle.
  2. We have ServiceWorker which could cache the static file/image, so these svg images request have little impact if hit the cache.

@exezbcz
Copy link
Member

exezbcz commented Jan 22, 2023

in the end its just this: image with applied blur on top. filter: blur(200px);

and what about this? @Jarsen136, the only pain would be only with positioning

@Jarsen136
Copy link
Contributor

with applied blur on top. filter: blur(200px);

and what about this? @Jarsen136, the only pain would be only with positioning

In this way, we still need to request some smaller svg and make some transforms by CSS. I guess it would not make too much difference in the LCP time, because there is servicework to cache the file. Maybe someone would have other approaches to improve performerce from code.

@exezbcz
Copy link
Member

exezbcz commented Jan 22, 2023

with applied blur on top. filter: blur(200px);
and what about this? @Jarsen136, the only pain would be only with positioning

In this way, we still need to request some smaller svg and make some transforms by CSS. I guess it would not make too much difference in the LCP time, because there is servicework to cache the file. Maybe someone would have other approaches to improve performerce from code.

ah okay, dont understand this tbh :D

@yangwao yangwao added p3 non-core, affecting less than 40% A-maintenance labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-maintenance p3 non-core, affecting less than 40%
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants