Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

RE: RE: Random Image in HTML

by swiftone (Curate)
on May 17, 2000 at 23:18 UTC ( [id://12220] : note . print w/replies, xml ) Need Help??

in reply to RE: Random Image in HTML
in thread Random Image in HTML

Your version returns the actual image, while the original does a Location to it. Which is more efficient (and in what way). My guess, without actually knowing/understanding the issues involved, is that Returning the location is more efficient because you don't have the single-line effect of <PIZZA> (I'm assuming that the webserver can do efficient largeblock file activities). How much webserver overhead does a Location reference build in comparison?

Replies are listed 'Best First'.
RE: RE: RE: Random Image in HTML
by turnstep (Parson) on May 18, 2000 at 18:26 UTC

    The second way (opening the image itself) is probably quicker because the browser only has to open a single connection. If it receives a location directive, then it has to send another request to the site. Further, I doubt that the "single-line effect" of <PIZZA> is much of an issue - even a large gif would get parsed so fast it would be hard to measure, and I doubt the webserver would be able to send it faster.

    P.S. Thanks, merlyn, you are right about the obtuseness. I'd change the original post but then your response wouldn't make much sense. :)