Static Sites Don't Need Next.js: Perfect Lighthouse via Framework Removal
A developer building a blogging platform started with Next.js and spent considerable effort optimizing caching, image handling, and CDN configuration. Despite these improvements, Lighthouse scores stalled in the 90s. Investigation revealed that Next.js ships a client runtime and 230KB of unused JavaScript even on entirely static pages. The framework includes this overhead because utilities like next/link and next/image are client components, which triggers hydration and pulls in the routing infrastructure regardless of whether the site needs interactivity.
Realizing a static blog doesn’t benefit from this overhead, the developer switched to Hono, a lightweight framework emphasizing simplicity and speed. The results were immediate: perfect 100 across all Lighthouse categories, unused code dropped to 407 bytes, and rendering performance improved 78% (long tasks fell from 309ms to 68ms). Build times also decreased by approximately 40%.
The takeaway challenges a common assumption in web development: interactive frameworks impose real costs on static sites. While Next.js remains valuable for applications with significant client-side functionality—the developer still uses it for the blog’s administrative backend—pure static content carries unnecessary JavaScript burden. For many blogs and documentation sites, simpler frameworks or plain HTML may better align with actual technical requirements.
Read the full article
Continue reading at Hacker News →This is an AI-generated summary. Read the original for the full story.