首页> 外文期刊>MSDN Magazine >WICKED CODE: Supporting Database Cache Dependencies in ASP.NET
【24h】

WICKED CODE: Supporting Database Cache Dependencies in ASP.NET

机译:邪恶的代码:在ASP.NET中支持数据库缓存依赖项

获取原文
获取原文并翻译 | 示例

摘要

Developers love the ASP.NET application cache. One reason they love it is that ASP.NET lets them create dependencies between items placed in the cache and files in the file system. If a file targeted by a dependency changes, ASP.NET automatically removes dependent items from the cache. Combined with cache removal callbacks―notifications broadcast to interested parties when cached items are removed―cache dependencies are a boon to developers seeking to maximize performance by minimizing time-consuming file accesses because they permit file data to be cached without fear of it becoming stale. As awesome as cache dependencies are, in ASP.NET version 1.0 they lack one critical feature that, if present, would qualify them as a developers dream come true: support tor database entities. In real life, most Web apps fetch data from databases, not files. But while ASP.NET is perfectly willing to link cached items to files, it is incapable of linking cached items to database entities. In other words, you can read the contents of a file into a DataSet, cache the DataSet, and have the DataSet automatically removed from the cache if the file it was initial ized from changes. But you can't initialize a DataSet with a database query, cache the DataSet, and have the DataSet automatically discarded if the database changes. That's too bad because too many database accesses, like too much file I/O, is a performance killer.
机译:开发人员喜欢ASP.NET应用程序缓存。他们喜欢它的原因之一是ASP.NET允许他们在缓存中放置的项目与文件系统中的文件之间创建依赖关系。如果依赖关系所针对的文件发生更改,ASP.NET会自动从缓存中删除依赖项。与缓存删除回调(通知在删除缓存项目时向感兴趣的各方广播)相结合,缓存依赖对于希望通过最小化耗时的文件访问来最大程度地提高性能的开发人员是有帮助的,因为它们允许缓存文件数据而不必担心文件过时。尽管缓存依赖非常棒,但在ASP.NET 1.0版中,它们缺少一项关键功能,如果存在,它将使它们成为开发人员梦想成真的条件:支持tor数据库实体。在现实生活中,大多数Web应用程序都是从数据库而不是文件中获取数据。但是,尽管ASP.NET完全愿意将缓存的项目链接到文件,但是却无法将缓存的项目链接到数据库实体。换句话说,您可以将文件的内容读取到数据集中,对数据集进行高速缓存,如果该数据集最初是从更改中更改的,则可以自动从高速缓存中删除该数据集。但是,您无法使用数据库查询初始化数据集,缓存数据集,并且如果数据库发生更改,则数据集会自动丢弃。这太糟糕了,因为太多的数据库访问(例如太多的文件I / O)是性能的杀手。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号