For certain reasons, I cannot use either mod_deflate or mod_gzip. Therefore, I am trying to implement its work using PHP. There is the following code:
$filecontents = file_get_contents($filename); header('Content-Encoding: gzip'); header('Content-Type: '.mime_content_type($filename)); echo gzcompress($filecontents); However, in the end, ERR_CONTENT_DECODING_FAILED takes off in Chrome. What could be the problem? The browser, of course, supports gzip unpacking.
$filecontents = file_get_contents($filename); header('Content-Type: '.mime_content_type($filename)); echo $filecontents;$filecontents = file_get_contents($filename); header('Content-Type: '.mime_content_type($filename)); echo $filecontents;Does everything return correctly? - E_p