I generally using such response syntax:
return response()
->json(['request'=> $data,
'response' => $response,
'client' => $client], 200);
How could I make it gzip
ed?
It's supposed to be configured per webserver basis. So it depends on which webserver you are using.
If it's Apache that you're using, mod_deflate is your place to go: https://httpd.apache.org/docs/2.4/mod/mod_deflate.html
For nginx: https://docs.nginx.com/nginx/admin-guide/web-server/compression/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With