我一般使用这样的响应语法:
return response()
->json(['request'=> $data,
'response' => $response,
'client' => $client], 200);
Run Code Online (Sandbox Code Playgroud)
我怎么能做到呢gzip
?
它应该根据网络服务器进行配置。所以这取决于您使用的网络服务器。
如果您使用的是 Apache,则 mod_deflate 是您要去的地方:https : //httpd.apache.org/docs/2.4/mod/mod_deflate.html
对于 nginx:https : //docs.nginx.com/nginx/admin-guide/web-server/compression/
归档时间: |
|
查看次数: |
3121 次 |
最近记录: |