From a2548ab5c201ca470fb5588cd041ac05b98e7086 Mon Sep 17 00:00:00 2001 From: FrankZamora Date: Wed, 26 Nov 2025 22:34:11 -0600 Subject: [PATCH] perf(featured-image): Optimize LCP with fetchpriority=high MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Disable lazy loading by default for featured images (LCP element) - Add fetchpriority="high" attribute for faster loading - Remove fetchpriority when lazy loading is enabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../FeaturedImage/Infrastructure/Ui/FeaturedImageRenderer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Public/FeaturedImage/Infrastructure/Ui/FeaturedImageRenderer.php b/Public/FeaturedImage/Infrastructure/Ui/FeaturedImageRenderer.php index 023fe981..94c7ce8c 100644 --- a/Public/FeaturedImage/Infrastructure/Ui/FeaturedImageRenderer.php +++ b/Public/FeaturedImage/Infrastructure/Ui/FeaturedImageRenderer.php @@ -160,16 +160,18 @@ final class FeaturedImageRenderer implements RendererInterface $content = $data['content'] ?? []; $imageSize = $content['image_size'] ?? 'roi-featured-large'; - $lazyLoading = $content['lazy_loading'] ?? true; + $lazyLoading = $content['lazy_loading'] ?? false; // LCP: no lazy por defecto $linkToMedia = $content['link_to_media'] ?? false; $imgAttr = [ 'class' => 'img-fluid featured-image', 'alt' => get_the_title(), + 'fetchpriority' => 'high', // LCP optimization ]; if ($lazyLoading) { $imgAttr['loading'] = 'lazy'; + unset($imgAttr['fetchpriority']); // No fetchpriority si es lazy } $thumbnail = get_the_post_thumbnail(null, $imageSize, $imgAttr);