61% of our HTML is inside scri... Note

61% of our HTML is inside script tags. Then I compressed it and found the real bill.

An analysis of notifio.app's 38 pages revealed that the actual HTML markup constitutes only 61.4% of the total document size. The majority of the data is the RSC flight payload, which is essential for Next.js App Router's client-side hydration and navigation. This payload results in sentences appearing twice within the document: once in the visible markup and again within the serialised React Server Components. While this duplication significantly increases raw file size, compression mitigates the impact considerably. The flight payload accounts for 55.3% of uncompressed bytes and 38.2% of compressed bytes. Content pages incur an additional 3.6 KB per view due to this duplication, while the homepage costs 6 KB. The pricing page is an exception, with content appearing only once in HTML and the rest in a cached JavaScript chunk. A significant portion of the downloaded data, approximately 300 KB gzipped, is shared JavaScript chunks across all pages. The framer-motion library, used for decorative animations on the homepage and footer, is included on all pages, even static ones like the terms and privacy policies. This dependency adds substantial overhead, with the footer's animated wordmark being a primary contributor. The author suggests that scroll-driven CSS animations could replace the JavaScript-based animation, eliminating the need for framer-motion on static pages and reducing the overall downloaded data. This optimization would also improve accessibility by respecting user preferences for reduced motion.