T
TanStack2w ago
environmental-rose

Deduping function calls on the server?

Is there any method for deduping calls on the server? I have a getSession function that I'm calling in several serverFns in the same SSR pass, and I'd like it to be invoked only once. I tried to create a cache on the request, i.e. sessionCache.get(getWebRequest()), but seems like the returned request does not have a stable identity. Is there anything else unique to cache by that will hold across a whole SSR pass?
2 Replies
sensitive-blue
sensitive-blue2w ago
we'll have something for that soon. you will be able to store data per request
environmental-rose
environmental-roseOP2w ago
Good to hear!

Did you find this page helpful?