Open AliceR opened 3 years ago
😱 Running a lighthouse audit
Now, this just happened
It is getting to a point where I wonder if these issues might be related to our recent upgrade to Gatsby v3. But maybe its also just me, adding a platform and instrument image on every platform card, where I should really look into pagination...
Seems like we need to prioritize and tackle this issue earlier than I initially thought.
wow, thanks for diving in to this! It looks like we have our work cut out for us. My guess is that images on all the cards was certainly a big part of this ☝️ . I think v3 only helped with some of our performance issues
Skipping the card images did make the deploy pass: https://github.com/NASA-IMPACT/admg-inventory/pull/282 I'll open a separate issue for the card images and keep this one focussed on the remaining performance issues.
Current lighthouse reports for three important pages:
Home
Explore platforms
Campaign page
Improving performance
I just watched a recent talk on Common Mistakes that degrade frontend performance https://www.twitch.tv/videos/994452019 This is a summary of my learnings I am planning to apply on this project:
JS Bundle analysis
gatsby-plugin-webpack-bundle-analyser-v2 wrapper around webpack-bundle-analyser, high level overview of all the bundles on the site. Which bundle is big? Great place to start
gatsby-plugin-perf-budgets Same plugin, but it applies page by page. Better insight into hashed bundles. Which javascript is loaded, app level vs. template level.
These are the sections:
This analysis gives clues on where to apply the next section hints:
Component Level Code Splitting
Out of the box, gatsby does page/template level code splitting. Sometimes you might want component level code splitting.
Global State Management
(not relevant for this project, but adding for completeness and possibly future reference)
(Too) Lazy Images
First and largest contentful paints account for half of the Lighthouse score (LCP).
PS: Gatsby offers a paid service to help improve performance: https://www.gatsbyjs.com/products/concierge/performance
Other resources
https://www.gatsbyjs.com/docs/how-to/performance/improving-site-performance/