开发者

ASP.NET MVC 3 + SQL Server 2008: How to implement cache invalidation for 1000s of product pages?

I'm building a web application in asp.net mvc 3 and SQL Server 2008 R2. The website is all about showcasing 1000s of products and each product has a dedicated web page. Each product page HTML is generated with the data from corresponding row of product table. When a row of product table is updated, I would 开发者_C百科like to invalidate the product web page alone.

I'm planning to use OutputCache feature of ASP.NET. Here are two question

  1. Does outputcache suits my caching requirement or is there any better cache mechanism?
  2. What is the best strategy for invalidating the cache of single page when underlying table data changes?


OutputCacheAttribute has an SqlDependency property.

A value that identifies a set of database-name and table-name pairs that the action's output cache depends on.

More info in this article.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜