I don't have much experience in caching among web applications, but I am trying to educate myself in the field and try out various techniques and approaches in ASP.NET MVC.
The majority of tutorials and articles I see online are mentioning output cache (
[OutputCache(VaryByParam="...")]), various donut caching methods etc.
Only a small part of articles I see online discuss methods of caching queries on top of data/business layer, which can be implemented with the aid of
System.Runtime.Caching or some other key-value store.
I've always thought that the usual bottlenecks in web applications are expensive or often-executed queries, not the part that does the rendering into HTML. At least from my own experience on projects I worked on, it has always been this way.
Subjectively, output caching also feels as a "dirtier" method than caching at the data/business layer. Why is it promoted so much? Is it only because it's easier to implement? Or am I missing some points?
Does ouput caching actually provide benefits over caching at data/business layer? In which kinds of web applications should I focus on which? How to find the balance between those two?
Caching techniques are generally considered to be a difficult topic in web develpment and it'd be great to have a bit more insight into output caching vs. data caching approaches, their differences, strenghts and weaknesses.