Just in case anyone else is wondering how to fix this, I succeeded by
using a function found here (using phps flush() function):
http://php.net/manual/en/function.flush.php

In my app controller:

        function _flush(){
                echo(str_repeat(' ',256));
                // check that buffer is actually set before flushing
                if (ob_get_length()){
                        @ob_flush();
                        @flush();
                        @ob_end_flush();
                }
                @ob_start();
        }

and in the reports controller just before I run my huge report that
normally times out IE7 + IE8:

$this->_flush();

And all is now working :)

I will eventually get my reports more optimised but for now this is a
great work around.

Hope this helps at least someone :)

On Nov 11, 10:51 am, Adrian <[email protected]> wrote:
> Hi Martin,
>
> Many thanks for the fast reply, I did read this post earlier and have
> since read up on star-schema and your CakePHP implementation. I am not
> hugely experienced with web development but have been doing it full
> time since I finished Uni in July and was never taught anything about
> denormalising databases for analytical processing, we always focused
> on storing data for transactions.
>
> I did wonder how people managed to get reports running so fast from
> software especially on a production server with multiple users. After
> reading about OLAP and star-schema it is pretty clear that this can
> give a huge performance boost to my reports so I will have a go at
> creating a schema for it and write a cron tab to execute the data
> transfer over night.
>
> To answer your questions:
> - Yes, IE seems to waits until the server has finished processing,
> then gives the error message. If I do the current months report for
> all clients it only takes about 5 seconds to load (I know this can be
> improved) but still doesn't display in IE
> - I experience the same issues in IE when cake debug is on or off
> - I am outputting as a html page using the same layout as the rest of
> the website
>
> Also, I have tried removing the html output so php just processes the
> data then echos "ok" and have the same problem in IE.
>
> I just don't understand why the page loads fine no matter how big the
> report from my local server (localhost) but not on the remote server.
> I assume IE has some rules which I am breaking which perhaps only
> apply to non local addresses.
>
> I will get to work on a start schema for my reports anyway.
>
> Thanks again for the reply :)
> Adrian
>
> On Nov 10, 11:46 am, Martin Westin <[email protected]> wrote:
>
> > I'll say from the start: I don't have the answer to your question.
>
> > I reply simply to clarify some points and ask for a few more details.
>
> > IE spends 12sec "loading" before displaying the error on one page. At
> > the same time IE spends 3min "loading" on another page before
> > displaying the same error. Is that correct? If so, it does not sound
> > at all like a timeout.
>
> > If other browsers take similar amounts of time but successfully
> > display the page, then a php memory problem is unlikely. More likely
> > is a (small) problem in your output or headers that make IE go nuts.
>
> > You get no error, warning or notice from php during the execution? (I
> > assume you are at debug 1 and have not in some other way suppressed
> > php's error output)
>
> > You are outputting html? Not xml, xls, csv or any other type of
> > generated "file", right?
>
> > My best advice for you is to not fix this problem but instead "fix"
> > your report-gathering so that it does not take 3min to process the
> > page. I suggest you look into aggregating and caching your data so
> > that the pages do not have to do the calculations each time. Data from
> > 3 months ago is not going to change is it? So, if you can process the
> > raw data via a cron job or something and store the aggregated data
> > ready for viewing then your page should load in a fraction of a
> > second, server cpu, ram sql... all will see significantly less load.
> > Everyone will be happy.
>
> > I prefer the star schema type of reports gathering. This is a
> > theoretical method of re-arranging your data so that it is suitable
> > for reports and in and you will be able to pull vastly different
> > reports from that same data a lot quicker than straight from your
> > normal data. On top of this you may want to further aggregate certain
> > data for specific reports.
>
> > I have written a few base-classes and methods to enable star-schema
> > generation in Cake. You will find my code and explanations in the
> > bakery.http://bakery.cakephp.org/articles/view/starschema-olap-setup-for-rep...
>
> > /Martin
>
> > On Nov 10, 11:18 am, Adrian <[email protected]> wrote:
>
> > > Hi,
>
> > > I am having the same issue as the following post:
>
> > >http://old.nabble.com/Timeout-on-IE-but-not-on-other-browsers-td18082...
>
> > > I have a controller for generating (sometimes large) reports and
> > >InternetExplorertimes out whenever I try to run a report. Firefox,
> > > Chrome and Safari are fine butInternetExplorer(tested on IE7 and
> > > IE8) displays the following error:
>
> > > "InternetExplorercannot display the webpage"
>
> > > The strange thing is the browser will take longer to load for a large
> > > report than it would for a smaller then show the error when it should
> > > render the page.
>
> > > As an example I generated a report with results from the last month
> > > for all clients and it took about 12 seconds then showed the error
> > > message. I then tried a report for all clients for the last year and
> > > it took about 3 minutes before showing the error message. Other
> > > browsers take around the same amount of time to load but show the page
> > > when finished.
>
> > > This issue is definitely not caused by Javascript as I have disabled
> > > this and it made no difference.
>
> > > I tried putting a line above my big query that outputs a space like
> > > suggested in the previous post:
>
> > > echo ' '; // Force IE to actually load the page
>
> > > This works, but only on my local machine. I uploaded the exact same
> > > change to the live (FreeBSD based) server and had the same problem as
> > > before.
>
> > > This only affects IE and I am out of ideas...
>
> > > If anyone could help it would be appreciated :).

--

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=.


Reply via email to