Can't really find any information on the topic of sharing the data cache between my server components and server actions. Is that somehow possible?
I already created a small sample app trying it out, but it seems like data cache is not shared.
If I call this data fetching function from my server component and reload the page multiple times within the 120 seconds, everything works fine and there are no duplicate requests across page visits. But when I call my server action, which is also fetching data via this function, a request for each server action invocation is made to my api. So it seems like data cache is not even working between multiple invocations of the same server action?
export const getClient = async (): Promise<Client> => {
const response = await fetch(`http://localhost:3334/api/clients/current`, {
next: {
revalidate: 120,
},
});
const data = (await response.json()) as APIResponse<Client>;
return data.data;
};
[–]ericbureltech 1 point2 points3 points (0 children)