tôi có mã sau để cache một số mã đắt tiền.trong bao lâu, theo mặc định, mọi thứ có trong httpcache nếu tôi không đặt hết hạn rõ ràng không?
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;
}
điều này sẽ ở lại trong bộ nhớ cache mãi mãi? cho đến khi máy chủ khởi động lại hoặc hết bộ nhớ?