Next.js Discord

Discord Forum

how to cache supabase user data

Answered
Bengal posted this in #help-forum
Open in Discord
BengalOP
Hey guys how do I cache supabase user data from supabase.auth.getUser? i know the docs talk about caching a lot with fetch but what about custom implementations of data fetching? Thanks
Answered by ᴉuɐpɹɐɐ
You can use unstable_cache to cache a function return other than fetch. But its still advisable to use fetch() and i know you can change the supabase fetch with next's fetch
View full answer

1 Reply

@Bengal Hey guys how do I cache supabase user data from `supabase.auth.getUser`? i know the docs talk about caching a lot with `fetch` but what about custom implementations of data fetching? Thanks
You can use unstable_cache to cache a function return other than fetch. But its still advisable to use fetch() and i know you can change the supabase fetch with next's fetch
Answer