public ActionResult Image()
{
string filePath = "D:\\123.png";
Response.Cache.SetExpires(DateTime.Now.AddDays(365)); // 缓存有效期为365天
Response.Cache.SetCacheability(HttpCacheability.Public); // 允许任何缓存服务器和浏览器进行缓存
Response.Cache.SetValidUntilExpires(true); // 缓存有效期由Expires头指定
return File(CommonHelper.GetImage(filePath), "image/png","123.png");
}
标签:缓存,浏览器,Cache,MVC,NET,Response,png From: https://www.cnblogs.com/QJZY/p/17714689.html