Skip to content

Conversation

@jasperf
Copy link
Contributor

@jasperf jasperf commented Nov 24, 2025

This release implements critical Core Web Vitals optimizations targeting the hero image and font loading behavior. The hero block's desktop image has been updated from lazy to eager loading with high fetch priority to eliminate the 2,360ms resource load delay that was negatively impacting Largest Contentful Paint (LCP) metrics. Additionally, font preloading has been added for Open Sans regular (400) and semibold (600) weights, which were causing a Cumulative Layout Shift (CLS) score of 0.602 due to late font loading and text reflow.

Hero Image Performance Optimization:

  • Changed hero desktop image loading strategy from loading="lazy" to loading="eager" with fetchpriority="high" attribute in HeroBlock.php:181-198
  • Addresses the root cause where lazy loading the LCP element caused the browser to wait for viewport intersection detection before initiating the download
  • Expected improvement of approximately 2+ seconds to LCP timing

Font Preloading Implementation:

  • Added early font preloading in setup.php:400-436 that runs at priority 1 in the wp_head hook
  • Resolves CLS caused by Open Sans loading after initial render, which triggered text reflow and layout shifts
  • Uses Vite manifest to dynamically resolve hashed font filenames for cache-busted URLs

Version and Documentation Updates:

  • Bumped theme version to 2.0.17 in style.css
  • Updated CHANGELOG.md with detailed root cause analysis and expected performance impact for both optimizations

Files Changed:

@jasperf jasperf merged commit 13f77e2 into main Nov 24, 2025
2 checks passed
@jasperf jasperf deleted the hero-image-and-font-loading-tweak branch November 24, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants