添加缓存 绝对时间过期

HttpContext.Cache.Insert("smscode", code, null, DateTime.UtcNow.AddMinutes(30), Cache.NoSlidingExpiration);

原文地址:https://www.cnblogs.com/maijin/p/7049539.html