I've got a page with an elaborate javascript in it (imageflow) that is meant to emulate the apple coverflow that you see on iPhones. It wasn't my idea to use it but I must fix it.
This elaborate javascript, in order to show reflections of an image, makes use of a PHP script that will take an image as input, invert it vertically and create a reflection image dynamically. The script is called reflect2.php.
The problem I'm having is that the reflect2.php script is unpredictably returning 403 (forbidden) or 404 (not found) errors sporadically. The behavior will vary for a given image so it's apparently got no relation to the image format. For example, I will load my page and I'll get some 403/404 for certain urls (which correspond to images in my page):
FIRST ATTEMPT - only one bad reflection image
http://mydomain.com/reflect2.php?img=product_images/ReynsRedemption_72SM.jpg&bgc=e3d8c7
The second time I load the same page, that previously broken image will be fine but this other one will be broken
SECOND ATTEMPT
http://mydomain.com/reflect2.php?img=product_images/Everlong_72SM.jpg&bgc=e3d8c7
The third time, all the prior images are fine and this image, which was fine before, is not 403:
THIRD ATTEMPT
http://mydomain.com/reflect2.php?img=product_images/TrustMeIfYouDare72LG.jpg&bgc=e3d8c7
I don't know why a given request to reflect2.php might result in a 403 reponse. As far as I can tell there is no code in the script that would result in such a header being sent for any reason whatsoever. I'm wondering if this might be a problem with Apache somehow. I'm on thin ice when it comes to Apache configuration values but perhaps there's a limit in the simultaneous connections permitted, the number of PHP threads available, or the keep-alive values or something?
Any thoughts about how to solve this would be much appreciated. Tomorrow is launch day 🙁