最近公司的項目要是用cloud Service 所以研究了下 Azure cache 的配置與使用。
首先創建項目
第二步 配置 cache worker role
(1) 點擊 cache worker role 項目的屬性設置。
(2)屬性Caching 設置
第三步 添加代碼到web項目的web.config配置文件(identifier應該是Cache role name or Service Endpoint)我們使用的是Cache role name 說以是identifier="CacheWorkerRole" 。
<dataCacheClients> <dataCacheClient name="default"> <autoDiscover isEnabled="true" identifier="CacheWorkerRole" /> </dataCacheClient> </dataCacheClients> <cacheDiagnostics> <crashDump dumpLevel="Off" dumpStorageQuotaInMB="100" /> </cacheDiagnostics>
第四步 下載Azure cache 包
第五步:開始寫自己的cache 代碼
新聞熱點
疑難解答