I am currently developing a web application which will be used by multiple clients, and I wish to display the clients logo on each page. The application is being developed using ASP.NET MVC3 and C#.
Normal convention suggests storing images in a database, but given that this image will be displayed on every page, I am concerned about the performance hit of doing this. If I store the image on the file system, the browser will cache the image and wont request it each time.
If I store the image in the database, will the browser also cache this, or will it call the function to request the image each time?
In such a case would I be better off storing the images on the hard disk of the server?
The (modern) browser doesn’t know what the server did to store the image. If the URL is the same, the browser will just pull up the cached version unless it was explicitly told not to.
In some circumstances you may need to disable caching:
http://www.example.com/random-imagewould probably serve up a different image each time it was accessed, and the browser would cache the first image served up.