HTTP 标头响应数据

发布于 2024-09-29 11:45:57 字数 52 浏览 1 评论 0原文

我想计算 PHP 中 http 响应标头和数据的大小(以字节为单位)。 任何帮助将不胜感激

I want to calculate the size in bytes of the http response headers and data in PHP.
Any help would be appreciated

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

很酷不放纵 2024-10-06 11:45:57

您无法通过 PHP 代码测量响应标头的大小,因为网络服务器可能会在提供响应标头之前对其进行更改。只有网络服务器可以测量这一点 - 并且您没有说明您正在使用什么网络服务器。使用 Apache,安装 mod_logio 并开始记录 %I、%O 和 %B

You can't measure the size of the response headers from your PHP code because the webserver may change them before serving them up. Only the webserver can measure this - and you don't say what webserver you are using. With Apache, install mod_logio and start recording %I, %O and %B

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文