image.php needs to send appropriate headers for caching... of course, i have no idea what they are, because i've never done dynamic images :) don't *think* mod rewrite will affect/help anything here.
Justin on 23/12/02 6:35 PM, Tim Molendijk ([EMAIL PROTECTED]) wrote: > Hi all, > > I'm storing a bunch of images in a MySQL database. I use a small PHP script > to load the appropriate image from database and flush it to the browser. > Because this script flushes in content-type image/jpeg (or similar) it can > be used as IMG SRC. So images can be shown on a webpage using the following > HTML: <IMG SRC="image.php?id=2"> > > This works perfectly fine but the browser (IE) does not cache these images. > On one hand I do understand why -- the image source is a script, not a > static image file, so the browser qualifies the resulting content as > dynamic. On the other hand though: in my setup image.php?id=1 is (as good > as) eternally the same image and for image.php?id=2, image.php?id=3, etc. > the same thing. So it would be no problem if the browser would cache f.e. > image.php?id=1 as if it is a static image. It would even be desirable > because it saves bandwidth. > > So actually the issue is: how can I get browser to cache image.php?id=1 (... > etc.) just as it caches image1.jpg (... etc.)?? The only thing I've thought > of is using mod_rewrite to rewrite URI's like image1.jpg into image.php?id=1 > but I haven't tried it yet -- don't know if it's a logical idea. > > Thanks in advance, > Tim Molendijk > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php