From 22df069c405b7610f79f550a70b9d3d98988c81f Mon Sep 17 00:00:00 2001 From: Joan Leon Date: Wed, 8 Apr 2026 11:24:16 +0200 Subject: [PATCH] docs(perf): update image best practices and TTFB thresholds based on feedback - Add width/height to elements for correct aspect-ratio in art direction. - Use realistic 'sizes' attributes in hero image examples. - Remove 'decoding=sync' from hero images to avoid blocking the main thread. - Align TTFB 'good' threshold with web.dev standards (800ms). --- references/performance-checklist.md | 6 +++--- skills/performance-optimization/SKILL.md | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/references/performance-checklist.md b/references/performance-checklist.md index 9cdec161..982f4543 100644 --- a/references/performance-checklist.md +++ b/references/performance-checklist.md @@ -20,7 +20,7 @@ Quick reference checklist for web application performance. Use alongside the `pe ## TTFB Diagnosis -When TTFB is slow (> 600ms), check each component in DevTools Network waterfall: +When TTFB is slow (> 800ms), check each component in DevTools Network waterfall: - [ ] **DNS resolution** slow → add `` or `` for known origins - [ ] **TCP/TLS handshake** slow → enable HTTP/2, consider edge deployment, verify keep-alive @@ -31,9 +31,9 @@ When TTFB is slow (> 600ms), check each component in DevTools Network waterfall: ### Images - [ ] Images use modern formats (WebP, AVIF) - [ ] Images are responsively sized (`srcset` and `sizes`) -- [ ] Images have explicit `width` and `height` attributes and/or CSS `aspect-ratio` (prevents CLS) +- [ ] Images and `` elements have explicit `width` and `height` (prevents CLS in art direction) - [ ] Below-the-fold images use `loading="lazy"` and `decoding="async"` -- [ ] Hero/LCP images use `fetchpriority="high"`, `decoding="sync"`, and no lazy loading +- [ ] Hero/LCP images use `fetchpriority="high"` and no lazy loading ### JavaScript - [ ] Bundle size under 200KB gzipped (initial load) diff --git a/skills/performance-optimization/SKILL.md b/skills/performance-optimization/SKILL.md index b3033c48..dcc37e04 100644 --- a/skills/performance-optimization/SKILL.md +++ b/skills/performance-optimization/SKILL.md @@ -162,35 +162,43 @@ const tasks = await db.tasks.findMany({ - Resolution switching (srcset + sizes): right file size per screen density --> - + - + Hero image description