I'm struggling with understanding how next'js caches data when using the use cache directive.
My main question is does nextjs cache data globally for all users to use.
Reading docs it says it generates the cache key by using the function id and the functions args. Does nextjs cache this data globally using the generated key? If it does my concern would then be around security if fetching say a users id inside the function instead of passing it through args and using it to fetch data and cache it would this then not be shown to everyone calling that same function which would then hit the cache?
How does revalidation then work? say i use unstable_cacheTag("known_tag") and i then use revalidateTag does that clear the cache for all users globally? there can be many different cached functions with the same cache tag so im just wondering if revalidating that tag calls all those functions to be revalidated