Cookie Caching in Better Auth Not Preventing database requests?

Hey everyone! I’m using Better Auth with cookie caching enabled, and I’ve also turned on logging for my Drizzle DB. But on every page reload, I still see DB logs from Drizzle. Shouldn’t the caching prevent repeated DB hits?
4 Replies
kubas
kubasOP2mo ago
it turns out that cookieCache only works for the authClient, not for server-side auth. Does anyone know how to implement caching on the server side? Should I create my own wrapper for the getSession function with custom caching?
Vlad
Vlad2mo ago
cache – React
The library for web and native user interfaces
Vlad
Vlad2mo ago
I guess this should work
kubas
kubasOP2mo ago
yeah it sounds like it might work, i will try it out tmrw, thanks!

Did you find this page helpful?