I'm not sure your numbers are correct, but you can use gzdeflate instead of gzcompress, since gzcompress adds 6 bytes to the output, 2 extra bytes at the beginning and 4 extra bytes at the end.
A simple test shows a 1756800 len string, compressed to 99 bits, by double compression, 5164 bits, if compressed once.
<?php $string = str_repeat('1234567890'.implode('', range('a', 'z')), 48800); echo strlen($string); //1756800 bytes $compressed = gzdeflate($string, 9); $compressed = gzdeflate($compressed, 9); echo '<br/>'.strlen($compressed).'<br/>';//99 bytes echo gzinflate(gzinflate($compressed)); ?>
source share