Hacker News new | past | comments | ask | show | jobs | submit login

The only reason the second page loads slower is because the user hasn't downloaded all the things they need to display it yet - in other words, you're suggesting downloading unused data on the first page in order to make the second page load faster. I'd argue that's not optimal because what you're gaining on the second page you're losing on the first page.

Also you always have to remember that users won't necessarily hit the homepage first. If they click a link from a search or a social media post they might end up on any page in the site. Everything that you do to optimize the homepage should be done for every page. You end up with cacheable assets that are shared between pages and everything else is only downloaded when the user hits a page that actually needs it. That's the way to a fast site.

With HTTP2 request parallelisation having lots of small files is not a bad thing. You can also add prefetch headers for big things like fonts. There's lots of ways to make sites load better.




Lighthouse doesn't care about HTTP2, it'll ding you for loading external files.

Also you're not just gaining for the second page, you're gaining for all pages visited on the site going forward.


> it'll ding you for loading external files

The Opportunities and Diagnostics sections don't contribute to your Performance score. Your overall Performance score is a weighted average of the Performance metrics [1]. The Opportunities and Diagnostics sections are just potential ideas on changes that may help you. It's up to you to decide what's best for your site.

[1] https://web.dev/performance-scoring/

Disclosure: I work on Lighthouse and web.dev


The Opportunities and Diagnostics sections may not, but your Performance score is affected by loading additional external files.


I've learned a ton for web perf stuff from the devtools and Lighthouse docs, so thanks for your work on those. :)


Webpack 5's federated modules have the potential to be a game-changer for addressing precisely this. Exciting times at the leading edge of webperf optimization.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: