Jerry Jones
2/7/2007 2:01:00 AM
I understand that browsers render the page, I could have worded that
better. What I was meaning was when a request is sent, would it be a
serious hit on performance to check for the image file, and if not
present, default to the 'no image available' image. Or would it be
best to have an index of the image file names and when a request is
sent to the server, it checks the index, and if the image file is not
listed, default to the 'no image available' image.
At the moment, I am running Webrick. I am trying to get IIS to work with RoR.
On 2/6/07, Brian Candler <B.Candler@pobox.com> wrote:
> On Wed, Feb 07, 2007 at 07:49:20AM +0900, Jerry Jones wrote:
> > On my website, I have a field in the sql server that lists the image
> > location/name to display for an item. All is wonderful. How can I have
> > the site select an 'image is no available' image if the file name it
> > is looking for does not exist?
>
> By configuring your webserver appropriately. You don't even mention what
> webserver you use, so you're not going to get a more specific answer than
> that here.
>
> However, as an example, if you are running Apache httpd then you can ask
> this question on the Apache httpd mailing list.
>
> > Right now, it is just showing the
> > alternate text, which is the image file name it is looking for.
> > Would it be a big hit on performance to have it check the images dir
> > for the file name prior to rendering the page
>
> Web servers don't render pages - web browsers do. Web servers response to
> HTTP requests, and send back the HTML for the page. What the browser does
> with it is its own responsibility.
>
> If the HTML contains a reference to an image, a separate HTTP request is
> made by the browser to retrieve the image. If the image doesn't exist (web
> server returns 404 Not Found) then it's up to the browser what to do next.
> Many display a "broken image" icon.
>
> Brian.
>
>