|
Posted by robert on 04/26/06 00:15
| This presumably covers your requirements and means that apache does all
| the work without having to use PHP to get the file, which is much more
| efficient. Also since the OS is being asked for a file then it's file
| caching functions swing in to force meaning the most common images are
| likely to be stored in RAM for even quicker delivery.
not to split hairs...but...
this dedicates you to only using apache as the web server and relies on
everyone having a list of detailed instructions (like you just gave) in
order to deploy the solution. not only that, but some people have web
hosting services that are pricks and won't allow you to do that.
and from all the hub-bub about using keys...it may as well *be* a file name.
one has an equal chance at guessing the next key as to guessing the correct
name of another image. further, in the method above, there is no graceful
way to display that the image was not found...apache simply either coughs up
a nasty error or your image's alt text will be all that's shown.
also, there is no real need to hit the db to see if the image exists. if you
need to display the details related to the image, that's another story.
finally, whether an image is cached in ram or read from disk is a non-issue.
that will never compare to the time lost during transport - especially for
larger images. the difference in times in preparing the image for transport
is nano-seconds at best.
i've said all that to raise valid considerations to the described
approach...not to knock the idea. if you program it correctly in php, you
can put the code on any server, any os, and never have to configure a thing
except the rights on the folder containing the images/files.
just a thought.
Navigation:
[Reply to this message]
|