In React we have latest new function called cache so what should be different between cache and useMemo hook in react
import {cache} from 'react';
In general, you should use cache in Server Components to memoize work that can be shared across components. cache is recommended for memoizing data fetches, unlike useMemo which should only be used for computations.
At this time, cache should only be used in Server Components and the cache will be invalidated across server requests.
Cache can also be used to preload data react.dev/reference/react/cache#preload-data