note 111488 deleted from function.header by tularis
| From: | tularis@php.net | Date: | Fri, 04 Apr 2014 11:28:37 +0000 |
| Subject: | note 111488 deleted from function.header by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-199161@lists.php.net to get a copy of this message | ||
Note Submitter: chris at willowsconsulting dot ie
----
It seems that this line of code is triggering a long TTFB on some Apache servers (either on Linux or
MacOS) having a GZIP compression ON:
<?php
header("Content-Length: ".strlen($content));
?>
If you are not serving binary files to download (like CSS, JS, or whatever), you can remove the line
of code.
This is what I have experienced:
TTFB without the line: 144ms
TTFB with the line: 5147ms (!!)
This weird behavior has been documented on some (old) version of IIS as well.
Conflict between mod_deflate and mod_fastcgi seems still unresolved...
It is your duty has a PHP programmer to cope with architecture/server problem~.