perf: LCP optimization - avatar, async CSS, deferred scripts#29
Merged
Conversation
Resize avatar.jpeg from 1536x2048 to 300x300 (appropriate for 110px display size with retina support). This is the LCP element and was causing 4.4s LCP times. Expected LCP improvement: 500-700ms
- Load Font Awesome CSS async via media="print" trick to prevent render blocking (expected: -400-600ms LCP) - Defer lunr.js search scripts to avoid blocking initial render (expected: -300-400ms LCP) - Add preconnect hints for cdn.jsdelivr.net, disqus.com, and googletagmanager.com to reduce connection latency (expected: -100-200ms) Combined with avatar optimization, total expected LCP improvement: ~1,300-1,900ms (from 4.4s to ~2.5-3.1s)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses the 4.4s LCP (Large Contentful Paint) issue identified in Cloudflare Web Analytics (Dec 28 - Jan 3). Google's "good" threshold is 2.5s.
Changes
media="print"techniquedeferto lunr.js scripts to prevent blocking initial renderExpected Results
Test Plan