[cgiapp] use persisten instance of cgiapp with cgi::fast?

Mark Fuller azfuller at gmail.com
Sun Jul 25 02:37:00 EDT 2010


Following up to the discussion about converting to Fastcgi (fcgi):

C::A only creates a new CGI object the first time the query method is
called. It seems like this method should accept a parm like "renew" to
allow it to create new CGI objects, replacing the old one.

When I converted my first C::A application to fastcgi I thought it was
an impact for me to have to change my prerun method to create new CGI
objects, and call C::A's method passing the new object, just to get
C::A to replace the object from the previous run.

I understand why C::A's query method only creates a CGI object the
first time it's called. (Applications might call the method numerous
times to get the query object.). But, it seems like it would be more
intuitive for the method to continue making all the new objects in
cases were persistence requires such processing. It just needs some
way to be told to delete its existing object (and/or, replace it in
one operation).

I use CGI::FCGI and CGI::Simple. I believe that users of CGI::Fast
(which uses CGI.pm) don't experience what I described above. I think
CGI::Fast does something to reset the existing CGI object, causing it
to parse the new request(?). But, I think it could affect other forms
of persistence. I remember 3-4 years ago someone experienced a similar
problem using one of Net::Server's persistent modes. He needed to
create a new CGI object with each "run" of C::A.

Mark


More information about the cgiapp mailing list