I have an ASP.net MVC 3 application running on IIS7.
It is an e-commerce application and I have OutputCache attribute set for some actions.
But now I’m thinking which cache is best to use, ASP.net MVC Outputcache or IIS7 cache? Or maybe both? (isn’t overkill?)
I found several places in the web talking about how great is ASP.net OutputCache and others talking about IIS7 cache but none explaining when we should use one or another, what are the advantages, etc.
You can use both for better performance. cache configuration in IIS will help you to reduce the the load(reduce the response content size) of consecutive responses over a period by caching the content in the client’s browser.( by setting the expiry period.This is generally applicable for your image, css content). MVC output cache attribute will retain the requested content for the subsequent requests.
If you are caching output/data only then better to use asp.net caching alone or either one. why because both are doing the same job. The way and place we ask for doing the job is different. In ASP.net caching you will get better control. Follow it..