rob howard
telligent systems, inc.october 24, 2004
summay: learn how to use database cache invalidation in asp.net 1.1 with a similar technique as the one used by asp.net 2.0. (8 printed pages)
ok, the title is a little tongue-in-cheek, but it got your attention right? the asp.net cache is by far one of my favorite asp.net features. why? because by using the cache you can gain some fantastic performance and scalability results, which can be easily measured and translated to real dollar savings for your application. this makes you the favorite code-monkey of your cto because you impacted the all-important return on investment (roi) of the application. in other words, the cache does save cash!
at a high-level, in asp.net 1.1, the cache is implemented as a hashtable supporting the concepts of a least recently used (lru) algorithm to ensure that if memory is needed, items can be removed from the cache—a set of programming interfaces for inserts and removing items from the cache—and finally the notion of dependencies, supporting time, file, and key dependencies.
the dependency model is one of the more important features of the cache because it allows statements such as: at this point in time, this item in the cache will no longer be valid (time based dependency). if this cache entry changes, this other cache entry is also invalid (key based dependency). if this file changes, this item in cache is no longer valid (file based dependency).
when programming with the cache, you always check to see if the item exists before using it. thus, when working with the cache it´s a good idea to follow the pattern below:
... 下一页