Okay, after going through hell for the past several days, a day or two after I post on the board I found the answer for myself 😉
So here it is for those who are having the same problems. Just be sure the following headers are being set with the most important being the Cache-control being set to public (or to what is needed).
Final code:
header('Cache-Control: public', TRUE);
header("Last-Modified: Tue, 31 Dec 2002 04:52:23 GMT");
header('Content-Transfer-Encoding: base64', TRUE);
header("Accept-Ranges: bytes", TRUE);
header("Content-Length: $fileSize", TRUE);
header("Content-Disposition: inline; filename=dd.jpg", TRUE);header('Content-Type: image/jpeg; filename="dd.jpg"', TRUE);
print ($binData);
Now I have all the information available when I do a properties on the image 😉
COOL CODE IMPLEMENTATION FOR THOSE WHO CARE
What I did is add an apache handler in my httpd.conf file. Now when I hit a certain directory, a handler is called and redirected to another page (a php script). That script grabs the referring URL which also contains the image name. I can grab the image and use it as params for my image get method from the db. The cool thing about doing this is that my URL look like:
/images/apacheHandler/key_20.jpg
where key can be a trigger in your code to get a certain type of image from the db and the number is the ID of that image.
Why do this, one, you image URLs in the image src are cleaner and look somewhat more like real image tags. More importantly, proxy servers and local caches actually work. I believe URLs with aprams don't cache to nicely. The old way to do the above would have been... perhaps...
/getImageScript.php?type=thumbPerson&id=20
If someone is remotely interested in my implementation, let me know and I'll post the solution.