I am trying to send gzipped content from the server. I have gzipped a file (get it here), and am trying to echo it out I have set the right headers (I think). The output starts of correctly, but only outputs the first so many lines.
<?php
$file = file_get_contents('kendo/js/kendo.all.js.gz');
header('Content-Encoding: gzip');
header('Content-Length: '.strlen($file)); # gets the correct filesize of my gzipped file
echo $file;
?>
Is there something wrong with my method?
The posted code works – there was another error, I am assuming a browser cache issue – but that has resolved itself.