简体   繁体   中英

What is the application life cycle using Perl Dancer?

Can someone explain the live cycle for a request in a Perl Dancer application starting from the server accepting the request. Does the application stay in memory like FCGI or does it have to be loaded for every request?

When using CGI, the application must be loaded with each request. FCGI, like you said, will keep the application running. Here's the lifecycle for CGI:

  1. loads the perl runtime
  2. loads necessary modules
  3. configures the application
  4. sets up all routes (not just the one needed)
  5. finds the correct route and handles the request.
  6. exits

When using FCGI steps 1-4 are done at load time. So if you are running with apache, when apache is started so is the perl runtime for your application. You are left with just step 5. Requests respond much faster when using FCGI.

Nowadays, many web shared webhosts support FastCGI, it's just a matter of configuring it correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM