PHP: Simple compression of JSON data
Just discovered how super simple it was to add some gz compression when for example providing JSON data from PHP. All you need is regular output buffering with the ob_gzhandler as output callback. // Fetch some data $data = get_data(); // Turn on output buffering with the gzhandler ob_start('ob_gzhandler'); // Output as normal echo json_encode($data); The cool thing is that it actually looks at ..
웹프로그래밍/PHP
2016. 6. 16. 09:36