So i have a nextjs site, and i have lots of server code before the page loads, and client componets. I idealy want to fetch user data on page load ie (username, email, balance, etc) and have that data shared with the server componets + client componets with the idealy least amount of api requests.
some ideas,
-
just having to fetch the data from db per call on the server side, then on the clinet side of a api request and then save to a content api
-
using cookies to store userdata per request, so each request and then each of the 30s or state update sync user data api request edit that data?