Re: serve long duration pages
| From: | Jochem Maas | Date: | Wed, 28 Jun 2006 16:52:19 +0000 |
| Subject: | Re: serve long duration pages | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-238812@lists.php.net to get a copy of this message | ||
John Gunther wrote:
> This may be more appropriate for an Apache or browser forum. Perhaps you
> can suggest an appropriate one.
>
> I have a PHP script that takes a long time to complete (due to very
> heavy database activity) although it echoes unbuffered output every few
> seconds. I've set max_execution_time to 0 with set_time_limit(0) so PHP
> doesn't time out the page but after about 3 minutes, Firefox says, "The
> connection to the server was reset while the page was loading." and IE7
> says, "Internet Explorer cannot display the web page". I want to try
> apache_reset_timeout() but it's not implemented in 4.3.10.
>
> Is there anything I can do from PHP or elsewhere to solve this?
yes.
lets start by saying that any webpage script that takes that long to run is
shit by design.
what I would suggest is that you run a script via cron that generates a static
page which you can then view whenever required; let the cron job run at what ever
interval is required/possible.
your database maybe be in bad shape - check you have indexes on all the fields
your searching/joining on (as a first step)
another alternative would be to break down the output of the script into
several pages.
sorry I don't have a real solution with regard to forcing the browser to
keep suckig on the connection. maybe someone else with more fu does.
>
> John Gunther
> Bucks vs Bytes Inc
>