You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Largest Contentful Paint (LCP)`_ is a key metric for web performance, it measures the time
212
+
it takes for the largest image or text block to be rendered on the page, and should be less
213
+
than 2.5 seconds.
214
+
It's part of the `Core Web Vitals`_ and is used by Google to evaluate the user experience
215
+
of a website, and impacts the Search ranking.
216
+
217
+
Using the Symfony UX LazyImage for your LCP image can be a good idea at first,
218
+
but in the reality it will lower your LCP score because:
219
+
- `The progressive loading (through blurhash) is not taken into account in the LCP calculation <https://github.com/w3c/largest-contentful-paint/issues/71>`_
220
+
- event if you eagerly load the LazyImage Stimulus controller, a small delay will be added to the
221
+
LCP calculation
222
+
- if you `didn't preload the image <https://symfony.com/doc/current/web_link.html>`_, the browser
223
+
will waits for the Stimulus controller to load the image, which add another delay to the LCP
224
+
calculation
225
+
226
+
A solution is to not use the Stimulus controller for the LCP image, but use ``src`` and ``style``
227
+
attributes instead, and preload the image as well:
0 commit comments