beyondhb1079 / s4us

S4US (Scholarships For Undocumented Students) aims to provide scholarships information for undocumented students
https://www.dreamscholars.org
2 stars 1 forks source link

Improve page load performance #1102

Open josueetcom opened 2 years ago

josueetcom commented 2 years ago

PageSpeed Insights rates our site at 90/100 for Desktop performance and 36/100 for mobile performance:

Screen Shot 2022-05-11 at 8 06 38 PM

We should really address performance issues by leveraging code-splitting (lazy loading) and Suspense: https://web.dev/code-splitting-suspense/

josueetcom commented 2 years ago

For reference, here is the score after #1108 but before #1114:

Screen Shot 2022-05-14 at 3 13 41 AM

Big gains in FCP and SI scores! #1114 should hopefully address LCP. Still gotta figure out how to improve TI and TBT :P

josueetcom commented 2 years ago

Looks like we have a better score now after merging those two PRs:

Screen Shot 2022-05-15 at 1 03 26 AM

TTI, LCP and TBT have dropped without affecting FCP and SI.

The score seems to vary after a runs but I think this is the first time I've ever seen PageSpeed insights give our site a score of 50+ on mobile.

josueetcom commented 2 years ago

What remains to be improved has to do with the JS we send to the browser. There's a lot of unused code:

Screen Shot 2022-05-15 at 1 14 35 AM

Unfortunately most of it is has to do with Firebase:

But, these are some things we could try:

The last one seems the most promising to me, especially since every major browser supports it since March 2017:

Screen Shot 2022-05-15 at 1 38 51 AM

It looks like at least 95.46% of browser versions used in the US fully support ES6. Of the ones tracked, 98.36%. And of mobile users specifically, 99.15%. Definitely seems like an easy win to me!

josueetcom commented 2 years ago

Next step: follow this guide to send modern JavaScript.

josueetcom commented 2 years ago

According to https://estimator.dev/#dreamscholars.org modern JS might only make the site around 12% faster :P