6
私は高価なコードをキャッシュする次のコードを持っています。明示的に期限を設定しないと、どれくらいの期間、デフォルトでhttpcacheに滞在しますか?
private MyViewModel GetVM(Params myParams)
{
string cacheKey = myParams.runDate.ToString();
var cacheResults = HttpContext.Cache[cacheKey] as MyViewModel ;
if (cacheResults == null)
{
cacheResults = RunExpensiveCodeToGenerateVM(myParams);
HttpContext.Cache[cacheKey] = cacheResults;
}
return cacheResults;
}
これは永久にキャッシュに残りますか?サーバーが再起動するか、メモリが不足するまで?