国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

ASP.NET的緩沖處理

2024-07-10 13:07:55
字體:
來源:轉載
供稿:網(wǎng)友
 

caching overview

caching is a technique that is widely used in computing to increase performance by keeping frequently accessed or expensive data in memory. in the context of a web application, caching is used to hold onto pages or data across http requests and reuse them without the expense of recreating them.

asp.net has two kinds of caching that can be utilized by web applications.

  • caching the dynamic response generated by a request is known as output caching.
  • the caching of arbitrary objects programmatically is known as data caching. to support this, asp.net provides a full featured cache engine that allows programmers to easily hold onto data across requests.

output caching is useful when the contents of an entire page can be cached. on a heavily accessed site, caching frequently accessed pages for even a minute at a time can result in substantial throughput gains. while a page is cached by the output cache, subsequent requests for that page are served from the output page without executing the code that created it.

sometimes it's not practical to cache an entire page--perhaps portions of the page must be created or customized for each request. in this case, it's oftentimes worthwhile to identify objects or data that are expensive to construct that are eligible for caching. once these items are identified, they can be created once and then cached for some period of time.

choosing the time to cache an item can make for an interesting decision. for some items, the data might be refreshed at regular intervals or the data is valid for a certain amount of time. in that case, the cache item can be given an expiration policy that will cause them to be removed from the cache when they're expired. code that accesses the cache item simply checks for the absence of the item, and recreates it if necessary.

the asp.net cache supports file and cache key dependencies, allowing developers to make a cache item dependent on an external file or another cache item. this technique can be used to invalidate items when their underlying data source changes.


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 灵璧县| 德清县| 谢通门县| 青海省| 瓦房店市| 乌鲁木齐市| 泌阳县| 赫章县| 南宁市| 聂荣县| 卢龙县| 类乌齐县| 天柱县| 巢湖市| 潍坊市| 阿拉善右旗| 昌平区| 玉环县| 平舆县| 谢通门县| 修水县| 天水市| 嘉义县| 蒲江县| 绥芬河市| 阿鲁科尔沁旗| 凤庆县| 宣化县| 胶南市| 肥西县| 青铜峡市| 灵台县| 凤凰县| 和政县| 石棉县| 太仆寺旗| 理塘县| 迭部县| 郧西县| 米林县| 尼木县|