开发者

ASP.NET Cache and Output Cache for Controls

You know I have the way to Cache the data I've got from the SQL Server over data caching. In addition I can output cache web user controls.

Whats about a web user control contains data from a SQL database? Does it make sense to cache the data and also cache the control?

What is th开发者_开发技巧e best solution for the combination of these two components?

Yes. this is a newbie question.


If you cache the control, then you don't need to cache the underlying data. Optimal caching, as always, depends on your application.

Here are some general guidelines:

Use data caching for complex, CPU/Memory intensive queries, for data that is used very often on different pages/controls.

Use output caching for controls that appear often. Output caching also tends to be simpler to implement compared to data caching with requires more thought concerning threading/locking, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜