开发者

How to continue PHP script in background without holding up display to the user?

Suppose I have some operations (e.g database INSERT queries) that need to be done in the PHP script, but I want to finish displaying the page to the user first before executing them.

One approach I've heard here is u开发者_Python百科sing HTTPResponse::send() following the display. What approach is best/fastest here?

Note/Update: I'm done displaying everything by the time I'm starting doing these INSERT queries. This is a static page.


Use ob_implicit_flush(true);. It will send any data echo'd, immediately to the user's browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜