一、浏览器缓存

服务器如果返回 cache-control:max-age=60,则表示服务器通知浏览器端可以缓存这个内容60秒

        //缓存3秒
        [ResponseCache(Duration = 3)]
        [HttpGet]
        public DateTime get()
        {
            return DateTime.Now;
        }

 浏览器端可以选择禁用缓存。

 

二、服务端缓存

app.UseCors();
//在UseCors后,MapControllers前app.UseResponseCaching(); app.MapControllers();

 

相关文章:

  • 2021-11-26
  • 2021-11-03
  • 2022-12-23
  • 2021-08-13
  • 2018-03-02
  • 2021-08-16
  • 2020-10-23
猜你喜欢
  • 2023-04-03
  • 2023-04-11
  • 2018-08-14
  • 2021-06-06
  • 2022-12-23
  • 2021-08-23
  • 2021-09-12
相关资源
相似解决方案