Good day
can somebody please tell me what is best practice to seng a gzipped stream back to client via CI4 ?\
I have the following logic todo this before a JSON string gets send back
PHP Code:
$negotiate = \Config\Services::negotiator();
$type = $negotiate->encoding(['gzip']);
if ($type == 'gzip') {
ob_start('ob_gzhandler');
}
//then return the json string
return $this->respondCreated($DummyDataArray);
Is this the correct way ?
Thank you
Johannes