-
Navigating around our app is pretty slow right now. It seems that a significant chunk of time is spent caching data in IndexDB. Here's the profiling: here's what we're using for IDB persistence (basically just the example):
And then, in our app.tsx, we're using these options:
What I can't figure out is this: Why is the set() method getting called so much? It's getting called even before the first trpc responses come through. It's getting called maybe 25 times per navigation. For reference, here's the browser's console: I notice the client is passed into the set method. Wouldn't that basically serialize all of the data in the app every time it gets called? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
yes, because we store it in one storage entry. for fine grained persistence, please checkout the there are tradeoffs in both approaches |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
yes, because we store it in one storage entry. for fine grained persistence, please checkout the
createPerister
api: https://tanstack.com/query/v5/docs/framework/react/plugins/createPersisterthere are tradeoffs in both approaches