-
Notifications
You must be signed in to change notification settings - Fork 21
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
Optimize Images and Media #2635
Comments
I think step 1, could be to convert all image styles to create webp images at After step 1, we can test to see how much we've benefitted. Step 2, could be to enable lazy loading on any media displays that don't already have it enabled. Looks like this when enabled in config. Lines 18 to 24 in 39387a8
After step 2, we can test to see how much we've benefitted. Step 3, Add additional responsive image styles for common use cases. One example of responsive image styles can be found in the full width media row module. (where we can reliably anticipate how large the final image container should be) Determine where we can use responsive image styles effectively. Examples of site owner/builder actions that affect how reliable a responsive image style is are:
If we find additional candidates for responsive images, implement and test. Step 4 (may be above step 3) Investigate whether there is a low cost front end solution we could implement. |
I think drupal lazy loading actually does not affect LCP, I think the lazy loading occurs before you actually get to them while scrolling, but I could be wrong |
The approach that was taken in the fix that was committed for this Drupal core issue could be instructive for us. This was about improving the LCP of the front page in the demonstration install profile included with Drupal core ("Umami") |
Re-opening since #3418 only added WebP related improvements. |
I'm lumping all of these into 1 issue because optimizing images is not just about reducing file size; it involves a comprehensive approach that takes into consideration size, format, compression, responsiveness, loading strategy, delivery mechanisms...etc
What is the problem that we want to solve?
Improve performance on Core Web Vital scores: starting with images. Large images take longer to load, leading to increased LCP times. By reducing the dimensions and compressing images without losing quality, you can substantially improve loading times.
A clear description of what's being investigated and why.
What to Investigate: Image Format: Deliver images in next-gen formats: deliver avif first, then webp, and finally jpg
Why: Converting images to more efficient formats can enhance performance.
What to Investigate: Responsive Images: How images adapt to various screen sizes and resolutions (using responsive image techniques). Each breakpoint should deliver in 1 of 3 formats based on support: avif, webp, or jpg
Use fetchpriority for LCP images. Generally, you should add fetchpriority=”high” to the first within any Hero widget
You’ll also want to ensure that the first image within any hero is not lazy-loading
Why: Serving appropriately sized images for different devices ensures that users aren't downloading more data than necessary. Since CDN solutions are not scalable to all of campus are there other baked in solutions in Drupal or a contrib module that could be leveraged?
3.What to Investigate: Lazy Loading: Whether images that aren't immediately visible on the page are being loaded later (lazy loading).
Why: Lazy loading allows images below the fold to load only when a user scrolls down to them. This can improve initial load times, positively impacting LCP.
Additional info:
https://web.dev/learn-core-web-vitals
https://web.dev/vitals
Compress SVG icons, Inline SVG icons in the HTML, Ensure images are appropriately sized to match their rendered size at multiple breakpoints, Preconnect to 3rd-party resources, Check if a font that’s being delivered from Google Fonts, Adobe Fonts (TypeKit), or Fonts.com is actually a system font, Ensure fonts are loading with font-display: swap, Check if the swap from a fallback font to a webfont is causing CLS issues
The text was updated successfully, but these errors were encountered: