keep everything within the database, so it is good for portability, backup etc. However you are putting unnecessary load on the database as it will have to transfer quite big chunks of data back to the web server. The browser will cache all images on a page, however dynamic URL's such as those with query strings usually will not get cached as the browser needs to check if a file has changed in order to know whether to reload it. This is not always true for all browsers all the time though, some do cache things they shouldn't.
Although i'm sure there are good reasons for some people to do this, I have never really found any good reason to store images in the database for the average website/app, just storing the URL/filename to the image has always been the best solution. The most common reason people come up with is security so they can stop others from acessing images they shouldn't, but this is also easily achievable with web server security such as .htaccess, which will stop anyone who doesn't have access from getting at files they shouldn't. HTH Russ On Wed, Oct 19, 2011 at 1:41 PM, JD Yeiter <[email protected]> wrote: > > Can anyone shed some light on this issue for me? I was originally storing > some images in a database, but then I convinced myself that it wasn't the > most efficient way to deliver the images, so I switched my solution to static > files. > > In general, can someone walk me through the pros and cons of placing images > that will be accessed heavily in a database versus keeping them in static > files? What I'm most curious about is: > > 1) When I use a .cfm page in the image tag (< img > src='getImage.cfm?id=282828'/ >), is it cached within browsers just like a > static file? > > 2) Is it too much strain on the database to be constantly requesting 5k - 60k > blobs? > > > Maybe I should just punt and start using Amazon S3? > > -donger > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348227 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

