Improve page load performance with lazy loading, caching, and font cleanup#80
Open
faradayfury wants to merge 1 commit intomainfrom
Open
Improve page load performance with lazy loading, caching, and font cleanup#80faradayfury wants to merge 1 commit intomainfrom
faradayfury wants to merge 1 commit intomainfrom
Conversation
…eanup - Add loading="lazy" and decoding="async" to ThemedImage inline images with a priority prop escape hatch for above-fold hero images - Defer PostHog initialization via requestIdleCallback so analytics doesn't compete with hydration - Add vercel.json with immutable cache headers for /fonts/* and /img/* - Add lucide-react to optimizePackageImports for better tree-shaking - Remove 17 unused font files (PPMori, THICCCBOI, .woff fallbacks, unused Delight weights) — 648KB → 144KB in public/fonts - Extract NETWORK_KEY to shared constants module to avoid pulling Web3Provider imports for a string constant
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
loading="lazy"anddecoding="async"to inline images with apriorityprop escape hatch for above-fold hero imagesrequestIdleCallbackso it doesn't compete with hydrationvercel.jsonwith immutable 1-year cache for/fonts/*and/img/*(repeat visits load from browser cache)optimizePackageImportsin next config.woffIE11 fallbacks, and unused Delight ExtraLight/Light/Thin weightssrc/lib/constants.tsso importing it doesn't pull in the entire Web3Provider moduleContext
Performance audit found 7.4MB raw / 2.1MB gzip of JS loading on every doc page. The dominant cost (5.5MB) is the Web3 stack bundled into a shared Turbopack chunk — fixing that requires moving showcase pages to a separate route (tracked separately). This PR covers the quick wins that don't require architectural changes.
Test plan
pnpm buildpasses (377 pages generated)pnpm validate:precommitpasses (lint + typecheck)