Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news-transit.tcx.org.uk!newsfeed.eweka.nl!eweka.nl!feeder3.eweka.nl!news.astraweb.com!border2.a.newsrouter.astraweb.com!border2.hitnews.com!xlned.com!feeder1.xlned.com!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="UTF-8" Message-ID: <7115120.c4VAs2iPgL@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Mon, 28 Nov 2011 01:53:51 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 8Bit Subject: Re: Order/Timing of Execution of PHP Newsgroups: comp.lang.php References: <4ed245c3$0$29369$a8266bb1@newsreader.readnews.com> Followup-To: comp.lang.php MIME-Version: 1.0 Lines: 28 NNTP-Posting-Date: 28 Nov 2011 01:53:51 CET NNTP-Posting-Host: 66e92800.newsspool3.arcor-online.net X-Trace: DXC=PBe8ICIIW;fPXlQ;h]GTMdMcF=Q^Z^V3h4Fo<]lROoRa8kF On Sun, 27 Nov 2011 12:01:47 +0000, Jeff Gaines wrote: >> It works but doesn't echo 'Creating Thumbnails' etc. until it has called >> the function and returned from it. > > Possibly caused by buffering on the server, or even the client waiting to > render output until it's able to decide what is to be rendered and how? > > I think it's better to do all the processing first, and then send the web > page afterwards, rather then send html in dribs and drabs while you're > doing the processing. This isn't the way I used to think, but it has > advantages. For example, you can trap and react to errors in the > processing by issuing http error headers, which you can't do if you've > started output. The disadvantage of it is that the user would have to wait for all PHP processing to finish before seeing any content. I have recently heard of an approach to mitigate, even solve, this problem, but I do not remember how it worked. PointedEars -- > If you get a bunch of authors […] that state the same "best practices" > in any programming language, then you can bet who is wrong or right... Not with javascript. Nonsense propagates like wildfire in this field. -- Richard Cornford, comp.lang.javascript, 2011-11-14