In-Process of Output Cache:
Advantage:
Speed Performance, while it is in the memory of the application; the speed is like read and write a variable. We can put any objects without serializing it in the memory (in out-of-process you have to) Perfect for a single application or a web application that runs just on one server.
Disadvantages:
In case, you have more than one server running your web application you cannot share cache between those two servers. Then you are limited to the memory of your server and filling up the memory of the server is dangerous because it can affect the whole system. The Cache will be deleted whenever your application is restarted because the cache like all your variables is in the memory of your app. So when you remove all cache, consider if you have a deployment strategy.
Out-of-process caching
Advantage:
Cache MEMORY is not shared with the memory of your server or servers. We are not limited to the memory of the serve. We will have a single place or cluster to read and write objects from and into the cache. Therefore you have shared cache between your servers. Cache memory is not deleted when our application is restarting.
Disadvantages:
This is slower than in-process caching.
You have to serialize the object first and then put it in the cache. Because the cache is on the network and your object has to be transferred over the network for reading and writing into the cache. And anything which is going to be transferred over the network has to be serialized and deserialized. (If you can find a way to transfer an object as it in the memory over the network you can start a new revolution in the digital world)
You are limited to the memory of your server and filling up the memory of the server is dangerous because it can affect the whole system.