Intermediate Page w/ CGI Script

Discussion in 'Perl Misc' started by Pete Butler, Sep 18, 2003.

  1. Pete Butler

    Pete Butler Guest

    I'm working on a CGI application using Perl. My client would like the
    user to get some sort of "processing request" page immediately upon
    clicking "Submit", because right now, he occasionally sees a delay
    between clicking "Submit" and getting the results page. Is there a
    good way to do this with CGI?

    The options I've been able to think of all have serious problems.
    Giving the user an immediate "thank you" page then processing the data
    behind the scenes (as a seperate thread? as a scheduled task?) sucks
    because the page the user gets is dependant upon the information
    passed in. (Certain data gets a "sorry, not interested" page.)

    I thought of making a CGI script that makes a quick-n-dirty "Thank
    you!" page that has all the data submitted by the user in hidden form
    elements which then submits itself, but that depends on the user
    having Javascript enabled, AND would require at least a moderately
    sophisticated script to power it, since the data set coming back from
    the user will be dynamic based on a few configurable items.

    And, of course, both options above require me to fire off a CGI script
    in the first place. Since I suspect that the performance issues
    driving my client's request are caused by starting CGI scripts when
    the server is under load, I suspect we'd go from this scenario:

    -Press Submit
    -Wait wait wait
    -See results page

    To this one:

    -Press Submit
    -Wait wait wait
    -See "please wait" page
    -Wait wait wait
    -See results page

    Is there a solution here I'm overlooking? (Short of using mod_perl or
    fastcgi to improve performance, which aren't available to me. Or
    switching to PHP; it's too late in the game for me to re-write
    everything from the ground up.)

    Or am I going to have to stick to my guns and insist that it's just a
    part of the whole CGI experience, and that the client needs to live
    with it?

    (And for those of you who like a little garnish of irony, I've been
    unable to replicate the performance problems my client is complaining
    about in the first place.)

    Thanks for your help,
    -- Pete Butler
     
    Pete Butler, Sep 18, 2003
    #1
    1. Advertising

  2. (Pete Butler) wrote in
    news::

    > I'm working on a CGI application using Perl. My client would like the
    > user to get some sort of "processing request" page immediately upon
    > clicking "Submit", because right now, he occasionally sees a delay
    > between clicking "Submit" and getting the results page. Is there a
    > good way to do this with CGI?


    http://www.stonehenge.com/merlyn/WebTechniques/col20.html

    > Or am I going to have to stick to my guns and insist that it's just a
    > part of the whole CGI experience, and that the client needs to live
    > with it?


    Personally, I would then never do business with you again.

    > (And for those of you who like a little garnish of irony, I've been
    > unable to replicate the performance problems my client is complaining
    > about in the first place.)


    That does not mean anything.

    Sinan.

    --
    A. Sinan Unur

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Sep 18, 2003
    #2
    1. Advertising

  3. Pete Butler <> wrote:
    > I'm working on a CGI application using Perl. My client would like the
    > user to get some sort of "processing request" page immediately upon
    > clicking "Submit", because right now, he occasionally sees a delay
    > between clicking "Submit" and getting the results page. Is there a
    > good way to do this with CGI?


    If your web server supports it, use a non-parsed headers script
    http://www.linux.psu.ru/pub/texts/ebooks/OreillyCD/web/cgi/ch03_08.htm
    Then, html will be displayed as the server serves it.

    --
    Glenn Jackman
    NCF Sysadmin
     
    Glenn Jackman, Sep 18, 2003
    #3
  4. Jim Gibson <> wrote in
    news:180920031129560958%:

    > In article <Xns93FA77767D91Basu1cornelledu@132.236.56.8>, A. Sinan
    > Unur <> wrote:
    >
    >> (Pete Butler) wrote in
    >> news::
    >>
    >> > I'm working on a CGI application using Perl. My client would like
    >> > the user to get some sort of "processing request" page immediately
    >> > upon clicking "Submit", because right now, he occasionally sees a
    >> > delay between clicking "Submit" and getting the results page. Is
    >> > there a good way to do this with CGI?

    >>
    >> http://www.stonehenge.com/merlyn/WebTechniques/col20.html

    >
    > Randal provided another version in the Aug 2002 issue of Linux
    > Magazine, available here:
    >
    > http://www.stonehenge.com/merlyn/LinuxMag/col39.html


    I had the other one bookmarked. Thank you for pointing that out.

    Sinan.

    --
    A. Sinan Unur

    Remove dashes for address
    Spam bait: mailto:
     
    A. Sinan Unur, Sep 18, 2003
    #4
  5. On Thu, 18 Sep 2003, Glenn Jackman wrote:

    > If your web server supports it, use a non-parsed headers script


    If this was a web servers configuration or CGI group, I would tell you
    that Apache doesn't demand the complication of using NPH scripts in
    order to support incremental output.

    But as it isn't, I suppose I'd better not :-}

    --

    (apologies if yesterday's attempt to post this does finally show up)
     
    Alan J. Flavell, Sep 19, 2003
    #5
  6. On Thu, 18 Sep 2003, Pete Butler wrote:

    > I'm working on a CGI application using Perl. My client would like the
    > user to get some sort of "processing request" page immediately upon
    > clicking "Submit", because right now, he occasionally sees a delay
    > between clicking "Submit" and getting the results page. Is there a
    > good way to do this with CGI?


    No different in Perl than in any other CGI programming language, and
    a requirement typically addressed in CGI FAQs and discussed on CGI
    programming group(s). What did you think of the previously-discussed
    solutions that you found while researching the topic prior to deciding
    to post a question? [hint!]

    > And, of course, both options above require me to fire off a CGI script
    > in the first place. Since I suspect that the performance issues
    > driving my client's request are caused by starting CGI scripts when
    > the server is under load,


    You haven't told us whether the wait is typically 5 seconds or 5
    minutes or what. Different solutions might be applicable.

    > I suspect we'd go from this scenario:
    >
    > -Press Submit
    > -Wait wait wait
    > -See results page
    >
    > To this one:
    >
    > -Press Submit
    > -Wait wait wait
    > -See "please wait" page
    > -Wait wait wait
    > -See results page


    Yup, that's very perceptive. The startup overhead might be a
    significant part of the whole processing (you haven't told us enough
    to be sure).

    > Is there a solution here I'm overlooking?


    Researching FAQs and previous discussions? :-{

    > (Short of using mod_perl or fastcgi to improve performance, which
    > aren't available to me. Or switching to PHP; it's too late in the
    > game for me to re-write everything from the ground up.)


    Sometimes, when you rule out all the applicable technical solutions,
    you are left with the original problem - as we can see.

    <announcement mode=public-service>
    In case you hadn't noticed, CGI questions aren't generally welcomed
    here (c.l.p.misc) unless they have some specifically Perl content -
    and that's irrespective of whether you're programming them _in_ Perl.
    perlfaq9 has further pointers.
    </>

    cheers
     
    Alan J. Flavell, Sep 19, 2003
    #6
  7. Pete Butler

    Pete Butler Guest

    .. . . and, of course, my sincere thanks to everyone who helped despite
    the marginal topicality of my question.

    -- Pete Butler
     
    Pete Butler, Sep 20, 2003
    #7
  8. >>>>> "Pete" == Pete Butler <> writes:

    Pete> I'm working on a CGI application using Perl. My client would like the
    Pete> user to get some sort of "processing request" page immediately upon
    Pete> clicking "Submit", because right now, he occasionally sees a delay
    Pete> between clicking "Submit" and getting the results page. Is there a
    Pete> good way to do this with CGI?

    I've done this in a couple of different ways...

    <http://www.stonehenge.com/merlyn/WebTechniques/col20.html>
    <http://www.stonehenge.com/merlyn/LinuxMag/col39.html>

    print "Just another Perl hacker," # and web whacker...
    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
    See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
     
    Randal L. Schwartz, Sep 21, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chad THomas

    Display intermediate/progress page

    Chad THomas, Jan 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    461
    Chad THomas
    Jan 19, 2004
  2. Rico
    Replies:
    4
    Views:
    1,556
    kaeli
    Mar 14, 2005
  3. Robin
    Replies:
    6
    Views:
    364
    Anno Siegel
    Apr 17, 2004
  4. kath
    Replies:
    4
    Views:
    800
    J. Gleixner
    Apr 9, 2007
  5. bhabs
    Replies:
    2
    Views:
    448
    Tad J McClellan
    Feb 13, 2008
Loading...

Share This Page