Images and media files (directly)
Purpose
Clarify what Speed Layer does and does not do for images and media.
What Speed Layer can do
Help the browser fetch key images earlier
Speed Layer can influence fetch timing for resources that are likely to become important visual content, such as a hero image that becomes the LCP element. On repeat visits, it can add preload hints early in the page lifecycle.
Background:
- MDN: link rel="preload" https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/preload
- Google: LCP https://web.dev/lcp/
What Speed Layer does not do
Speed Layer does not directly change media assets. It does not:
- Compress images
- Convert formats (for example, JPEG to WebP or AVIF)
- Resize images
- Re-encode video
- Change your image CDN configuration
Those improvements require changes to image delivery, the CMS, or the CDN.
What to do if images are the main problem
If image weight is a major contributor to slow load times, common approaches include:
- Using modern formats when supported (WebP, AVIF)
- Serving responsive image sizes
- Ensuring images have appropriate width and height attributes to reduce layout shift
Public references:
- Google: Image optimization https://web.dev/fast/#optimize-your-images
- MDN: Responsive images https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images
Related pages
- How Speed Layer Helps Largest Contentful Paint (LCP)
- What Is CLS (Cumulative Layout Shift)?
- What Speed Layer Does and Does Not Do