Last post Sep 17, 2010 02:08 PM by atconway
Sep 16, 2010 07:55 PM|hell666|LINK
I would like to know whats the best approach to store images for websites . The problem is i plan to have several websites on a web farm and 1 cms that control the content of the websites. The users will be required to upload images that will appear on the
Should the images be uploaded in each websites or stored at a central location (CMS side) which all websites will access from?
Is the idea of having a central image server to solution to go towards?
Thank you for your help.
Sep 16, 2010 11:24 PM|robv8r|LINK
We've used a hybrid approach. Images are uploaded to a database server via an internal admin interface for the CMS tool. When the image is requested from one of the public webfarm servers, the public server checks for the presence of the image on its own
local disk. If it exists, it serves the image. If not, it reads it from the database, writes it to disk, then serves it from disk.
There are obvious drawbacks to this approach. It's slower than having a static image server. It also requires that the web server check for the existence of a file before any action can be taken.
There are also some advantages. We use query string parameters to resize images on the fly. When we render the resized image to disk, it's then available at the new dimensions far quicker than if the image were resized on every request. We also use this
approach with watermarks.
Sep 17, 2010 02:08 PM|atconway|LINK
The problem is i plan to have several websites on a web farm and 1 cms that control the content of the websites. The users will be required to upload images that will appear on the websites.
I have an almost identical setup and we use a centralized location with a website sitting on top so images can be accessed either by UNC or http (i.e. http://MyImages/Folder1/Picture.png or \\MyServer-1\Folder1\Picture.png). I prefer pulling images from
a url obviously to mask the true location, especially if rendered on a webpage and identified in source. I would go with the single file system location and use SQL to manage the paths for referencing to a specific account if that is what you need.