PHP是否包含HTTP请求? [英] Is the PHP include an HTTP request?

查看:87
本文介绍了PHP是否包含HTTP请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近阅读了一篇有关为什么不应该使用太多HTTP请求的文章,因为这会降低服务器的速度.至少对于JavaScript AJAX HTTP请求而言,这似乎是正确的.但是PHP包括什么呢?如果我发送4个AJAX请求与将1个AJAX请求发送到随后有4个PHP包含提取的页面相比,服务器性能会有所不同.

I recently read an article about why you shouldn't use too many HTTP request, cause it will slow down your server. Which seems to be true, at least with JavaScript AJAX HTTP requests. But what about the PHP include? Will there be a difference in the server performance if I send 4 AJAX request compared to if I send 1 AJAX request to a page which then does 4 PHP include fetches.

这是我要解释的情况的图片:

Here's an image of the scenario I'm trying to explain:

推荐答案

简短的回答是 PHP包含的不是HTTP请求,并且在脚本执行期间由PHP解释器进行处理.

Short answer is NO PHP includes are not HTTP requests and are being processed by PHP interpreter during script execution.

但是,通过HTTP 有一种称为 include的东西,这是在特定情况下使用HTTP协议包含文件的情况.

However there is something called include through HTTP, which is specific scenario where you include file using HTTP protocol.

您可以从PHP手册中阅读此链接以获取更多信息: http://php.net/manual/en/function.include.php

You can read this link from PHP manual for more information: http://php.net/manual/en/function.include.php

这篇关于PHP是否包含HTTP请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆