What approach would you prefer for our client-side caching? #282
-
We're researching how to implement client-side caching for our ecosystem (jira issue here: https://jira.dhis2.org/browse/LIBS-166). I've taken a look at a couple of libraries, with react-query and swr in particular. I've implemented them in the app-runtime in a rudimentary fashion, with tests to demonstrate the functionality. I've also added react-query directly to an app, using the data-engine as a fetcher, to test what that approach would be like. PRs below:
If you're interested, I've left notes on what stood out to me about each approach. The purpose of this discussion is to form an initial opinion on what we all prefer, and why. I recommend going through each PR, linked docs and the notes to get an idea of each approach. After that, we should have more of an idea of our needs, concerns, etc. I was thinking as a follow up we could then investigate further, see if any concerns/needs can be addressed. After that a meeting to decide which approach to go with and then the final implementation. To structure the discussion a bit, I've suggested each approach as an answer to the main discussion question: What approach would you prefer for our client-side caching?
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
I gave a thumbs-up to the internal solution using I noticed |
Beta Was this translation helpful? Give feedback.
-
We are missing one point of comparison here, and that is SWR implemented directly in an app with the DataEngine as a fetcher. Without it, I don't think react-query directly in an app is qualified as an option, unless SWR-in-app was left out for a reason? |
Beta Was this translation helpful? Give feedback.
react-query
used internally in the app-runtime: dhis2/app-runtime#824