[next.js] should i cache this query?
i have a function that queries my database for a list of stories. if a user is logged in, the stories shown are automatically filtered based on categories and authors they have chosen to hide.
should i cache the query results? i think that if i wrap the entire thing in
unstable_cache
, those query results will be shown to every user, but i'm not 100% sure.1 Reply
here's the query code, for anyone interested.
getCurrentUser
grabs the currently logged in user for that request based on cookies.