model view controller - Prevent Image Caching in MVC 2 C# -


I have a profile image upload page, where users can overwrite their previous profile picture.

But when I return users to my profile page, the browser has cached their previous image and only gives an F5 refresh new image.

Is the browser preventable from caching the image, because some users may think that their new upload has failed.

Ideally, I would like to prevent the image from being cached. But donut caching promptly indicates that it is not possible to do this in MVC 2 ... ??

Thanks for any indication.

Pausing caching is a very bad idea. Instead, consider using the technology with a clear "version":

  http://www.example.com/users/johndoe/avatar.jpg?43567  

An avatar is saved every time, to increase this number and you are good to go. Or, instead of having a clear version, you can to ToFileTime () . You can use the value of the date / time column (if you have one) changed to has been updated .

/ div>

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -