I'm working with an image caching system that generates different images based on a url route. The source images live outside the document root and cached versions are added to /cache in the webroot. Long story short, in Flash, if I point a Loader
to the route, I get a "Load Never Completed" error the first time (if the cached image has yet to be generated).
Error opening URL 'http://characters.dev/cache/Pledges/16107/48_48c/jen001.jpg'
Error #2036: Load Never Completed. URL: http://characters.dev/cache/Pledges/16107/48_48c/jen001.jpg
The cached image is still generated and the next time I run the application the actual file loads without error. I've got the proper headers being sent when generating the initial image and writing it, so I'm wondering why flash isn't getting the response (seems to works fine in a browser window).
header("Content-type:image/jpeg");
echo $this->getResponse()->setBody(file_get_contents($cachedFile));
Any ideas on how to fix this? The errors seems to "bog down" the flash application.
If it helps, here's the response headers:
Request to generate image:
HTTP/1.1 200 OK
Date: Tue, 23 Jun 2009 17:52:49 GMT
Server: Apache
X-Powered-By: PHP/5.2.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Set-Cookie: PHPSESSID=6b746d4ed010c288a824522597698ea2; expires=Fri, 24-Jul-2009 17:52:50 GMT; path=/; domain=.characters.dev
Content-Length: 3575
Content-Type: image/jpeg
Request when image is cached:
HTTP/1.1 200 OK
Date: Tue, 23 Jun 2009 17:53:27 GMT
Server: Apache
Last-Modified: Tue, 23 Jun 2009 17:52:50 GMT
ETag: "24e6c62-df7-a8bd0080"
Accept-Ranges: bytes
Content-Length: 3575
Content-Type: image/jpeg