Caching server Functions?
Hello,
To cache some server functions in my tanstack Start app I do this:
the server function:
the cache middleware:
I'm using the npm package
cache-manager
under the hood, which is either initialized using Redis in prod or in memory otherwise.
Is this ok ?
Thanks in advance :).3 Replies
helpful-purple•2mo ago
why shouldnt it be okay?
sunny-greenOP•2mo ago
just asking to be sure 🙂
helpful-purple•2mo ago
it looks good to me
it could probably be generalized a bit so you could cache arbitrary functions