What I found out is that this approach executes cgiapp_init() and setup() on *every* request (which isn't desireable as I load my templates there, establish caches etc and these steps should run only once!).
CGI::App definitely needs to get re-initialized for each request. Even if you could find a way to work-around the problems you've found so far you'd end up getting burned again the first time you tried to use a plugin that needed per-request initialization.
So, instead of hacking CGI::App, hack your code. In your setup() you could do something like:
our $INIT_DONE; unless ($INIT_DONE++) { # do some cache init, or whatever ... }
That way you can do your one-time-only initialization in your setup and it will only happen the first time through.
-sam
In reply to Re: CGI::Application under FastCGI (Guru advice needed)
by samtregar
in thread CGI::Application under FastCGI (Guru advice needed)
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |