Make your application more reactive with a client-side cache

Written by _Bearfoot | Published 2017/03/23
Tech Story Tags: javascript | react

TLDRvia the TL;DR App

Have a single-page or mobile application with intense “Back to the previous list” usage? Are you fetching the exact same data every single time the user is pressing the “back” button?

In this case, you can improve your application user experience and relieve your API at the same time.

Let’s have a look at some popular application.

On the first image, you can see a list of files and folder. Now, let’s go to docs, that’s the second image. When you come back to the parent folder, the same request that was performed the first time will be performed again, making your application slower and using server resources when it could have remembered the data and displayed it right away, giving the user an instant result.

A word of caution, if you alter the data, or if the data is altered by someone else and if the changes need to be shown, you need to update your cache accordingly. That would be the case for Github.

At the moment, the way I do it is with Apollo Client http://dev.apollodata.com


Published by HackerNoon on 2017/03/23