2 Replies Latest reply on Oct 1, 2008 2:44 PM by ProjectedSurplus

    Coldfusion and Image Storage

    ProjectedSurplus Level 1
      It seems from my research that there are high level scalability to storing site images inside CF8/wwwroot/myApp/images ????

      Specifically as <img src="images/blah.jpg"> generates a separate http request AFTER the page is downloaded to the browser then why not have the webserver respond with the image rather than involving the cfAppServerr?

      At present I'm developing on a WindowsServer2003 with IIS6 box that has the cf dev web server installation on it so I test pages at http://www.myIP:8500 (but realize this will change upon going to production though haven't ever done so)

      Now then, at present I can save a copy of the images into C:\Inetpub\wwwroot\images and access them via <img src=" http://www.myIP/images/blah.gif" /> which I assume is accomplishing this but am I missing something in terms of security/performance/ability to upload/????

      Once we are no longer using port 8500 is this still possible -- and if so how would I address the different location?

      I know there are issues regarding other sites using your images that need to be addressed but have to assume there is a way to code the webserver (iis or apache) to disallow all access except from www.mysite.com ???

      I've read some blogs on <cfinclude> and/or mappings blogs but this again seems mainly to "cost" the cfAppServer

      I'm not opposed to someday need/want to move to a dedicated machine specifically for images storage and serving but assuming a 3 Tier (webServer-CF8-database) off-hand it seems better for redundancy to put the images on the webserver???

      What about porting to flash on the front-end (I know there are sandbox/cross-domain issues but don't know much about them)?

      And finally, given the overhead of repeated separate image requests, is there a way to combine the request for a collection of images (whereever it goes to) into one single (HTTP) transaction?

      Thanks in advance (for just reading this far if nothing else :)

        • 1. Re: Coldfusion and Image Storage
          Level 7
          i am not quiet sure what your problem is...

          CF does NOT serve your images - web server does. CF does not handle
          those mime types, it's the web server's job. you can make cf handle and
          serve them, but why?

          since you are using cf's built-in web server in your development, that
          web server (jrun) serves your images. once you switch to iis/apache -
          they will serve your images instead.

          you can configure your web server to cache your images, which will make
          it serve them faster from its cache rather than requesting the image
          every time. but a request for an image using <img> tag is always a
          separate http request. and not just with <img> tag - images you use in
          your styles/stylesheets are requested separately, too.

          so, as i said, not sure what your issue is... can you please clarify?

          Azadi Saryev
          • 2. Re: Coldfusion and Image Storage
            ProjectedSurplus Level 1
            k, I guess what I was asking is why store the images in C:\cf8\wwwroot as opposed to inside the web servers C:\Inetpub\wwwroot\images\ and I guess what you answered is that either way <img> images are served by the webserver and not the cfapplication server (unless <cfinclude> or the like is used).

            Now, the <cfinclude> strategy has been proposed in a few blogs as a way to avoid image leeching by outside sites but I'm mainly interested in a 3 machine independent hosting setup (webserver, cfappserver, dbase) in which case I see advantages in speed/efficiency, security and portability by storing images on the webserver box (or even on a 4th box dedicated to images but then this adds another point of failure vis a vis using the webserver box).

            Fwiw I realize this is overly complicating things before necessary but especially with the advent of virtual machines running on the same high performance box, why not?

            Similarly with regard to the last point, rather than say 50 HTTP requests for 50 images, if there were an easy way to send one HTTP request asking for and then receiving in a single response all 50 images (which would then be parsed at the client level) and/or is this efficient/practical????