I'm programming an ASP.NET MVC4 application which stores uploaded images as byte[]
in a database (with Entity framework) and then displays them. To display the images I'm using this code in the view:
<img src="data:image;base64,@System.Convert.ToBase64String(item.ImageByte)" alt=""/>
But each time I refresh the page I see that the browser does not cache the image and just renders it again causing unecessary bandwith usage.
Maybe there's a more bandwith friendlier way to display the image? Maybe the idea to store uploaded image as 'byte[]' was stupid in the first place (my application is just a simple web page which stores articles about psychology :D with an admin panel to achieve this) and I should just store images in a folder?
Thanks