Asp.net core 客户端响应缓存

在controller方法前加入  [ResponseCache(Duration =20)]即可实现缓存 ,这个例子显示缓存20秒,

    [ResponseCache(Duration =20)]
    [Route("[controller]")]
    public class GetPatientTop10Controller : Controller
    {

        [HttpGet(Name = "GetPatientByTop")]
        public IEnumerable Get(string DispensingDate)
        {
            return MyDB.Patient.GetPatientListtop10(DispensingDate).AsEnumerable();
        }
    }

你可能感兴趣的:(asp.net,core,java,servlet,mybatis)