How to Cache image when src is some action which returns image?

Posted by Bipul on Stack Overflow See other posts from Stack Overflow or by Bipul
Published on 2010-04-09T09:05:46Z Indexed on 2010/04/09 9:13 UTC
Read the original article Hit count: 304

Filed under:
|
|

There are lots of questions about how to force the browser to cache or not to cache any image. But, I am facing slightly different situation. In several places of my web page, I am using following code for the images.

<img title="<%= Html.Encode(Model.title)%>" 
  src="<%= Url.Action(MVC.FrontEnd.Actions.RetrieveImage(Model.SystemId))%>"/>

So, in the generated HTML it is like

<img title="blahblah" src="http://xyz.com/FrontEnd/Actions/RetrieveImage?imageId=X">

Where X is some integer. I have seen that though the browser (IE or Mozilla) caches images by default, it is not caching images generated by above method.

Is there any way I can tell browser to cache images of above type?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about caching

Related posts about images