简体   繁体   English

长时间运行的CGI脚本挂起

[英]Long-running CGI script hangs

I have a CGI script that takes a few minutes to run. 我有一个CGI脚本,它需要几分钟才能运行。 I want to keep it very simple. 我想保持它很简单。 Currently, it prints some information about the process and then starts running it. 当前,它打印有关该过程的一些信息,然后开始运行它。 When complete, it shows the result of the job. 完成后,它将显示作业的结果。

It works perfectly when I load it in telnet. 当我在telnet中加载它时,它可以完美运行。 However, Firefox doesn't show the header information until after the process is complete. 但是,Firefox在完成该过程之前不会显示标题信息。 Is there some JavaScript call or DOM setting that I can use to tell the browser to load the information it already has and hold tight? 是否可以使用一些JavaScript调用或DOM设置来告诉浏览器加载其已有的信息并保持紧密状态?

Again, I just want something simple as the script already works quite well as-is. 再次,我只想要简单的东西,因为脚本已经按原样工作了。

If the header information has HTML tags that aren't closed until the process is complete, the browser may wait till it gets the closing tag before it renders the HTML. 如果标头信息包含直到处理完成才关闭的HTML标记,浏览器可能会等到它获得关闭标记后再呈现HTML。

You can try restructuring your HTML to avoid that or use multipart/x-mixed-replace to push updates as your CGI script progresses. 您可以尝试重组HTML以避免这种情况,或者在CGI脚本进行时使用multipart/x-mixed-replace推送更新。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM