The problem here is that it depends upon your browser's behaviour. If you have a browser that wants to load the entire source before it starts rendering (lynx was and probably still is a good example of this), then the user will see nothing until the process has entirely finished. This is not a good thing.

The other problem is that browsers will usually get bored and time-out if they don't see any connection on a socket for a long enough period of time, or if the connection remained open for too long. So your browser might get bored and drop the connection after 50% of the processing has been done, even if you have been sending "progress updates".

So while you can have a solution that might work 100% of the time under your favourite or most popular browsers, it's not going to work 100% of the time with all browsers. This is where client-pull comes in handy, just about everything supports (or should support) refresh tags, so you don't have to worry about the user's browser getting bored, not displaying the progress reports, or wandering off to do other things.

Cheers,
Paul


In reply to Re: Re: Re: CGI progress indicator by pjf
in thread CGI progress indicator by JungleBoy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.