MVC3 data caching techniques

前端 未结 3 1904
误落风尘
误落风尘 2021-02-06 11:02

I have a sql query (stored proc) that takes about 8-10seconds to return before the results are displayed in a webgrid. What is best practice for performance regarding cacheing

3条回答
  •  轮回少年
    2021-02-06 11:31

    How often your underlaying data behind this stored procedure change? If relatively rarely, you can use very good feature - SqlCacheDependency

    http://msdn.microsoft.com/en-us/library/ms178604.aspx

    This way your heavy SP will be called only when needed, and result will be cached as long as possible.

提交回复
热议问题