67P / kredits-web

Kredits Web UI
https://kredits.kosmos.org
6 stars 2 forks source link

Cache data in browser storage, and load from local cache when present #189

Closed raucao closed 4 years ago

raucao commented 4 years ago

With this change, all data will be stored in your local IndexedDB after fetching it. Then, when present on app launch, it will be loaded from the cache, instead of the network. After the loading screen has finished, the app will then fetch updated data from the network.

Aside from the obvious speedups for users who visit more than once, there's also one considerable performance optimization baked into this PR for completely new users: it will only fetch the last 30 contributions from the network when loading the app for the first time, and then fetch the last 200 after rendering the page (and add them to the list when done).

closes #182