是否可以避免为每个请求加载脚本 [英] Is it possible to avoid loading the script for each request

查看:75
本文介绍了是否可以避免为每个请求加载脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不懂PHP,考虑用这种技术编写CGI,并且

有以下问题。


是否可以调用PHP脚本让它无休止地等待来自网站(在我的情况下是一个Java小程序)的请求,并在它们到达时提供

请求?我想避免为每个

请求加载脚本。


换句话说,从这个意义上说,它可以像Java servlet一样运行吗? />

I do not know PHP, consider to write a CGI with this technology and
have the following question.

Is it possible to invoke a PHP script and let it endlessly wait for
requests from a website (a Java applet in my case) and serve the
requests when they arrive? I want to avoid loading the script for each
request.

In other words, can it function, in this sense, like a Java servlet?

推荐答案

6月1日凌晨3:00,DavidNorep< avdavid.nore ... @ gmail.comwrote:
On Jun 1, 3:00 am, DavidNorep <avdavid.nore...@gmail.comwrote:

我不懂PHP,考虑用这种技术写一个CGI并且

有以下问题。


是否可以调用PHP脚本并让它无休止地等待来自网站(在我的情况下是一个Java applet)的

请求,并在它们发出时提供

请求到达?我想避免为每个

请求加载脚本。


换句话说,从这个意义上说,它可以像Java servlet一样运行吗?
I do not know PHP, consider to write a CGI with this technology and
have the following question.

Is it possible to invoke a PHP script and let it endlessly wait for
requests from a website (a Java applet in my case) and serve the
requests when they arrive? I want to avoid loading the script for each
request.

In other words, can it function, in this sense, like a Java servlet?



你想避免为每个请求加载脚本

的具体原因是什么?

What is the specific reason that you want to avoid loading the script
for each request?


为了节省时间,能够回复更多请求。


我还有另一个问题,这可能是每个CGI的一般问题,

无论采用哪种技术。


假设CGI正在运行并且另一个请求到达,即它是

由另一位访问者访问该网站;将CGI的另一个实例开始运行,或者第二个请求会等到运行CGI的
完成其工作还是有办法控制这个

行为。

To save time, to be able to respond to more requests.

I have also another question which is probably general for every CGI,
no matter in which technology it is implemented.

Suppose that a CGI is running and another request arrives, i.e., it is
invoked by another visitor to the website; will another instance of
the CGI start running or will the second request wait until the
running CGI finishes its work or is there a way to control this
behaviour.




" DavidNorep" < av ************* @ gmail.comwrote in message

news:11 ***************** *****@q75g2000hsh.googlegr oups.com ...

"DavidNorep" <av*************@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...

为了节省时间,能够回复更多请求。


我还有另一个问题,这可能是每个CGI的一般问题,

无论采用哪种技术。


假设一个CGI正在运行,另一个请求到达,即,该网站的另一个访问者调用它是
;将CGI的另一个实例开始运行,或者第二个请求会等到运行CGI的
完成其工作还是有办法控制这个

行为。
To save time, to be able to respond to more requests.

I have also another question which is probably general for every CGI,
no matter in which technology it is implemented.

Suppose that a CGI is running and another request arrives, i.e., it is
invoked by another visitor to the website; will another instance of
the CGI start running or will the second request wait until the
running CGI finishes its work or is there a way to control this
behaviour.



我认为像Apache这样的程序用于在一个

时间处理多个请求。在多用户环境中,虽然你需要考虑多个

的人同时进行更改以及潜在的冲突

人们同时改变同样的事情。


Tom

-

Newsguy.com - 无限帐户

现在有32个并发连接

I think programs like Apache are used to handling multiple requests at one
time. In a multi-user environment though you need to account for multiple
people making changes at the same time and the potential conflict with
people changing the same thing at the same time.

Tom
--
Newsguy.com - Unlimited Accounts
Now with 32 concurrent connections


这篇关于是否可以避免为每个请求加载脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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