Skip to content

Cache the home-page locally, reducing perceived load time

Yuto Takano requested to merge faster-perceived-home-page into master

This MR adds local storage caching for category data & category metadata, for the home-page. This uses around 25-35 kB with 100-150 courses, which I deem acceptable.

The impact is large, since the perceived loading time of the home page reduces dramatically:

  • For new visitors, performance is the same
  • For returning visitors landing on the home page, they only have to wait for auth, instead of auth + categories
  • For visitors navigating from another page in the SPA, it is instant since auth is already performed

It also solves a cosmetic issue with two LoadingOverlay being laid on top of each other on the home-page (one from HomePage while categories load, one from UserRouteContent while auth loads).

We've employed this strategy in University of Edinburgh's fork since last year, and you can see for yourself the improved perceived loading times: (open them in incognito windows, do one fresh load, then reload the page to see the effect of the cache -- you can see the cards show up even while the small loader is still performing a fresh request)

Merge request reports

Loading