Re: Browser displays blank page, while request still being handled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 9, 2006 12:14 pm, Rolf Wouters wrote:
>
>>> The script behind the request does the following:
>> Also, if the script terminated and Apache sent a non-200 return
>> code,
>> then the browser "knows" it never got the real page, and may be
>> trying
>> to help you by getting the true page when you do "View Source"  I
>> think switching browsers may actually help this somewhat, as they
>> behave differently in these boundary conditions.
>>
>>
> I took your advice and installed the firefox plug-in.  Only
> header-info
> I got from my blank page is "Status: ok - 200", nothing else (maybe I
> should mention again, that at this moment, the script is still
> running...).
> In the rare cases that the "publish" procedure does return the correct
> result-page, the headers look quite different (i.e. a lot more
> information than just the status)

So, here is what happens.

#1. Browser asks for URL
#2. PHP starts spitting out *SOME* content (maybe even just a blank line)
#3. Browser gets "Status: ok - 200"
#4. PHP script is really really really slow
#5. Browser gets tired of waiting for more output, and gives up on PHP
#6. PHP keeps going and going and going and...

There is no mystery, here, really.

It's a bit odd that no other headers come out, but it's possible,
depending on the code...

Your application is still not designed for a web environment when
large numbers of images are involved, really.

You're gonna have to bite the bullet (as suggested before) and make
the dog-slow image-processing bits be asynchronous with the page
generation, by having:
  the script queues up the stuff to be done, and
  the script spits out a super-fast page saying "We'll have your
photos ready shortly -- You will be notified when they are ready"
  some kind of cron job works on the queue regularly
  when the queue for client X is empty, or a whole batch is done, or
whatever, they get an email, and can do whatever needs doing next in
human time.

By the time you do all that, the whole problem will go away.

You could even do it ONLY when the number * size of the files exceeds
X if you want.  So only the one client will be affected by (and
exercising) the code with the cron job.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux