Feb 19, 2014, 07:00 am
One small possible optimization I can think of is reducing number of calls to fgets.
You can preg_match for "Content Length" in the first few reads, locate end of header (blank line ?) and then read the content/body with one single fgets().
But I notice you have commented out the line which adds Content-length to header. Why is that ?
But I still wonder why all this ? :-)
Code:
while (!feof($fp)) { $content .= fgets($fp, 128); }
fclose($fp);
But I notice you have commented out the line which adds Content-length to header. Why is that ?
But I still wonder why all this ? :-)