.net cache

1. why use cache

can increase performance by storing memory data that is access frequently and that requires signficant processing time to create.

2. application cache

the application cache provide a programmatic way for you to store arbitaray data in memory using key/value pairs.

3.diifference between application cache and application state

The cache is volatile but the application state is statice, the cache is not stored in memory for the life of application.the cache can be remove when the data is expire or become invalidated, or when the memory runs low.

4.page output cache

stores the contents of a processed asp.net page in memory. use when a page don't change often and require significant processing to create.

two modles: full page cache and partical page cache.

5.automatic data removal

three statements: 1.scavenge 2.expired 3 dependency changed

6 about scavenge

scavenge is the process of deleting items from cache when memory is scarce. Items are delete when they have not been accessed in some time or when items are mark as low priority when add to cache. ASP.NET uses the CacheItemPriority to determine which items to scavenge first.

7.Expiration

we can set expire time for cache when added.there are two types of expiration

a.sliding expiration: specified how long after an item was last accessed that it expires.for example , you can set an item to expire after 20 mins after it was last accessed in the cache.

b.absolute expiration: specified that an item expires at a set time, regardless of how often it accessed. eg. you can set an item to expire at 6:00 pm or after four hours.

8. dependency

configure an item's lifetime in the cache be dependent on other application elements such as files or databases. when the element that a cache item depends on changes, asp.net removes the item from the cache

转载于:https://www.cnblogs.com/huangwj21/archive/2010/10/22/1858374.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值