Microsoft introduced Output Caching with .NET 7.
As far as I understood, Output Caching caches the HTTP response while In-Memory Cache stores data in the memory of the server.
I don't feel sure about which of the two I should use from now on. Is there a general recommendation? In case it depends on the scenario, can anybody list some examples / scenarios where it makes more sense to use Output Caching instead of In-Memory Cache and vice versa?
I'm aware that there are also Distributed Caching and Response Caching, but they're out of scope for this question.