[object Object]

← back to Wallco Ai

perf(/design/:id): add fetchpriority=high + decoding=async to .detail-img + preload it in <head> via htmlHead({preloadImages}); detail-img is THE LCP candidate on the detail page

effa221678b2f99f1db65b2405e03dad42ae823d · 2026-05-14 15:40:05 -0700 · SteveStudio2

Files touched

Diff

commit effa221678b2f99f1db65b2405e03dad42ae823d
Author: SteveStudio2 <stevestudio2@SteveStacStudio.lan>
Date:   Thu May 14 15:40:05 2026 -0700

    perf(/design/:id): add fetchpriority=high + decoding=async to .detail-img + preload it in <head> via htmlHead({preloadImages}); detail-img is THE LCP candidate on the detail page
---
 server.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/server.js b/server.js
index f94f875..a182167 100644
--- a/server.js
+++ b/server.js
@@ -5832,7 +5832,11 @@ app.get('/design/:id', (req, res) => {
       retailer_item_id: design.handle || `wallco-${String(design.id).padStart(4,'0')}`,
       brand: 'wallco.ai',
       category: design.category
-    }
+    },
+    // Preload the detail image — it's THE LCP candidate on /design/:id.
+    // Pairs with fetchpriority=high on the <img> tag so the browser
+    // double-confirms this is the most important image to start fetching.
+    preloadImages: [design.image_url]
   })}
 <body>
 ${htmlHeader('/designs')}
@@ -6037,7 +6041,7 @@ ${htmlHeader('/designs')}
       </style>
 
       <div class="detail-img-wrap">
-        <img src="${design.image_url}" alt="${design.title}" class="detail-img" id="detail-img" loading="eager" crossorigin="anonymous">
+        <img src="${design.image_url}" alt="${design.title}" class="detail-img" id="detail-img" loading="eager" fetchpriority="high" decoding="async" crossorigin="anonymous">
         <canvas id="detail-canvas" style="display:none"></canvas>
 
         <!-- ── COLOR STORY — palette dots + Sherwin-Williams + Dunn-Edwards rows

← 7ffca96 perf(home): preload hero[0] + first 4 featured card images i  ·  back to Wallco Ai  ·  feat(/designs): dynamic OG image when filtered — sharing /de f0fe84b →