Last active
August 29, 2015 14:26
-
-
Save slav123/d65e7f6e0cf8560cb07e to your computer and use it in GitHub Desktop.
Compress JS output with codeigniter output library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$this->output->set_header('Content-Encoding: gzip') | |
->set_header('Vary: Accept-Encoding') | |
->set_content_type('application/json') | |
->set_output(gzencode(json_encode($data), 9)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment