[Canberra-pm] [Fwd: Re: Writing output to a web browser like clearing a buffer]

Jacinta Richardson jarich at perltraining.com.au
Fri Jun 24 01:22:35 PDT 2005


Sorry, I forgot to send this to all just in case someone else might disagree or 
alternately find it useful...

-------- Original Message --------
Subject: Re: [Canberra-pm] Writing output to a web browser like clearing a buffer
Date: Fri, 24 Jun 2005 17:17:57 +1000
From: Jacinta Richardson <jarich at perltraining.com.au>
Organization: Perl Training Australia Pty Ltd
To: John.Hockaday at ga.gov.au
References: <158ADDBA43E6C748BBD230A469EC6A4D9984CE at mail.ga.gov.au>

John.Hockaday at ga.gov.au wrote:

> Is there a way that I can clear the buffer to print to the browser without
> having to wait for the whole page to be generated?

Have you checked to make certain that the problem is with the CGI script and not
with the browser?  If your content is embedded in a great many tables which
exist purely for layout purposes, then you may find that your browser is caching
the response until it has sufficient information to render everything correctly
and only then giving you your output.  (This is why CSS is a better alternative)

If this might be the cause, strip off all the formatting information outside of
your data and see if things improve.

If that doesn't help, try using something like wget to grab the page and output
it to a file.  Follow the file creation with a tail -f and see whether all the
data comes in one big lot, or continuously.

If your data is simple, but involves one huge table of information, see whether
you can improve matters by telling the browser how big the table will be and how
wide the columns are.  Use colgroup tags and percentage widths to achive this.
If this doesn't work, see if it is possible to break the table up into smaller
sections.  Careful use of colgroup information on your tables can make it
possible to have many separate tables still look like one big one.  Both of
these methods mean that your user can look at the first part of the table while
the other rows render.

If it definately *is* the CGI program (which sounds unlikely as it should run
almost as fast through the server as on the command line) then we can all have
fun trying to optimise it.  :)

All the best,

     Jacinta

-- 
    ("`-''-/").___..--''"`-._          |  Jacinta Richardson         |
     `6_ 6  )   `-.  (     ).`-.__.`)  |  Perl Training Australia    |
     (_Y_.)'  ._   )  `._ `. ``-..-'   |      +61 3 9354 6001        |
   _..`--'_..-_/  /--'_.' ,'           | contact at perltraining.com.au |
  (il),-''  (li),'  ((!.-'             |   www.perltraining.com.au   |




-- 
    ("`-''-/").___..--''"`-._          |  Jacinta Richardson         |
     `6_ 6  )   `-.  (     ).`-.__.`)  |  Perl Training Australia    |
     (_Y_.)'  ._   )  `._ `. ``-..-'   |      +61 3 9354 6001        |
   _..`--'_..-_/  /--'_.' ,'           | contact at perltraining.com.au |
  (il),-''  (li),'  ((!.-'             |   www.perltraining.com.au   |




More information about the Canberra-pm mailing list