in reply to CGI::Application under FastCGI (Guru advice needed)
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI::Application under FastCGI (Guru advice needed)
by isync (Hermit) on Nov 28, 2007 at 23:30 UTC | |
by samtregar (Abbot) on Nov 30, 2007 at 19:36 UTC |