TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How we improved our website's performance

123 pointsby kkmover 4 years ago

11 comments

seanwilsonover 4 years ago
&gt; Around the same time we switched from an (outdated) manually created critical CSS file to an automated system that was generating critical CSS for every template — homepage, article, product page, event, job board, and so on — and inline critical CSS during the build time. Yet we didn’t really realize how much heavier the automatically generated critical CSS was.<p>Is reducing the total amount of CSS per page so you don&#x27;t have to calculate the critical CSS at all an option?<p>To throw my own page into the ring, here&#x27;s a non-trivial product website of mine where the homepage is 0.3MB total over the wire and renders in 0.4 seconds for me (includes custom fonts, payments, analytics, large screenshot and real-time chat widget):<p><a href="https:&#x2F;&#x2F;www.checkbot.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.checkbot.io&#x2F;</a><p>The major tricks I&#x27;m using is keeping the website CSS small (CSS for homepage + rest of site gzips to less than 8KB), inlining all CSS, rendering default fonts before the custom font has loaded, SVG for all images (this saves a ton), and not using JavaScript for content (which blocks rendering).<p>The screenshot in the header is in SVG format and inlined directly into the page along with the CSS, so the moment the HTML arrives the browser can display all above the fold content. Logos are another good one for the SVG + inline treatment.
评论 #25896271 未加载
评论 #25896254 未加载
评论 #25900018 未加载
评论 #25897808 未加载
评论 #25900667 未加载
评论 #25900927 未加载
nicbouover 4 years ago
It&#x27;s still way too slow. It&#x27;s a big page of text. It should load in an instant.<p>In my browser, I see 1.75 MB sent over the wire and a 2.5 second load time. My big pages of text [1] need 105 kB and load in 0.4 seconds. Their compressed critical CSS is the same size as my entire uncompressed CSS file. They send more CSS bytes than I send bytes in total.<p>If you want to make a content website fast, it&#x27;s quite simple: send just the content.<p>[1] <a href="https:&#x2F;&#x2F;allaboutberlin.com&#x2F;guides&#x2F;german-health-insurance" rel="nofollow">https:&#x2F;&#x2F;allaboutberlin.com&#x2F;guides&#x2F;german-health-insurance</a>
评论 #25896125 未加载
评论 #25895547 未加载
评论 #25895771 未加载
评论 #25897238 未加载
lwansbroughover 4 years ago
Nice to see another company covering all these steps and validating the work we&#x27;ve done at my company. Unfortunately we weren&#x27;t as successful, or at least, our results were not as fruitful. A good score for our site (tracker.gg) is 70 on mobile. Turns out it&#x27;s pretty hard to optimize the bootstraping of an application that can render 20 different websites! Mobile devices spend 1200ms on the main thread. It will be interesting to see how these changes impact our page rank when Google starts incorporating Core Web Vitals into its algorithm this year.
franklytover 4 years ago
12 people for a static site seems like a huge team to me.
评论 #25895899 未加载
评论 #25897123 未加载
worldofmatthewover 4 years ago
Not fantastic: <a href="https:&#x2F;&#x2F;www.websitecarbon.com&#x2F;website&#x2F;smashingmagazine-com-2021-01-smashingmag-performance-case-study&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.websitecarbon.com&#x2F;website&#x2F;smashingmagazine-com-2...</a>
评论 #25895465 未加载
评论 #25898018 未加载
olliepopover 4 years ago
key takeaways:<p>- fonts can be unnecessarily huge<p>- monolithic js = slow. Chunk at build time.<p>- content-visibility: auto for lazy rendering
评论 #25896801 未加载
joegahonaover 4 years ago
Page Speed Insights shows this site scoring a poor 39&#x2F;100.
brazzyover 4 years ago
&quot;Modern&quot; web development is apparently a game of Jenga.
评论 #25896734 未加载
评论 #25895512 未加载
评论 #25895492 未加载
评论 #25897896 未加载
brainzapover 4 years ago
The layout jumps
throwaway189262over 4 years ago
Snarky TLDR: half the JS load time was ad scripts. IMO Most of the performance increase was around specifying image heights, using facades for third party embeds, and optimizing around ad and analytics scripts.<p>Nice write up but not a big surprise to anyone that blocks analytics tracking, ads, and third party embeds.
hizxyover 4 years ago
Such an odd design for the site.