Caching in nextjs with supabase

Hey guys i have a question about a project im building, for context i am building a CRM type of app and i have a few tables like customers, customers_services etc.. all these tables have an officeId from a table called offices, Offices is the way i seperate data for my users which will have their own customers ,this means that for almost every page of my app i need to do the auth.getUser from supabase, then use that user to find the office in which he belongs and get his office id, and then use that office id for any other query like getCustomers. My question is should i cache that office id using unstable cache? It might be a dumb question but on almost every tutorial/course no one caches his data which makes me think there might be a reason or smth
1 Reply
visshhhal
visshhhal2mo ago
a simpler alternative to unstable_cache would be to store the office id in local storage.

Did you find this page helpful?