How to cache output of action method that returns image to the view in asp.net mvc?
问题 I've read lots of posts about caching already, but none of them actually match my needs exactly. In my mvc 3 app I have an action method GetImage() that returns a File of image type. Then I use this method in a view to display image: <img width="75" height="75" src="@Url.Action("GetImage", "Store", new {productId = item.ProductId})"/> I want to cache images on a Server. So, what I've already tried: 1) to use OutputCacheAttribute: [HttpGet, OutputCache(Duration = 10, VaryByParam = "productId",