P
Pete Butler
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
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