In ASP.Net MVC we have page output cache. we do this by adding the attribute [OutputCache]
Then there is HTTP caching which is used by browser. I hope i'm correct up to this point. Using HTTP headers we can enable or disable this HTTP caching.
Is there a relation between above two. If i disable either will it impact on other.
Output caching tells the server to hold the rendered result of the page (as a string) in server memory - ready for the next request. This means that (for example) any database or file requests needed to populate data for the page does not need to happen against for further requests whilst the cache remains valid - as well as the (small) overhead of building the view and any components or partials. HTTP caching tells the client and/or downstream proxies that the content will remain valid for the specified period - and that it can be served from a local or proxy cache without having to be re-requested.
It is worth noting that child actions can have OutputCache applied - allowing you to cache portions of the page which do not change between users, whilst still allowing per-user customisation of the page over all. This is sometimes called Donut Hole Caching (where the "hole" doesn't change but the rest of the "donut" around it does).
There is another concept of "donut caching" where the majority of a page is cached by a small portion (the hole) is not - but this is not yet supported out of the box in ASP.NET MVC.
The OutputCacheAttribute does allow you to specify the "location" - client, downstream, server, server and client - which allows a handy method to specify both client and server output caching in one place, but each can be controlled independently.