For various reasons, I need to play an intermediary between the HTTP request and the file on disk. My approach was to fill out the headers and then execute the readfile ('/path/to/file.jpg');
Now everything works fine, except that it returns a medium-sized image very slowly.
Can someone provide me with a more efficient way to stream the file to the client after sending the headers?
Note. This is a linux field in a shared hosting environment, if that matters
source
share