Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks
I'm currently building website using CGI::Lite
But it's still slow because of compilation time
uWSGI needs to compile the perl script everytime when a user login, logout, search, create post ...etc
I tried PPerl but the site malfunctioned (sometimes worked sometimes page not found)
I can't even install CGI::SpeedyCGI, PersistentPerl
I spend two days googling around and I don't know what to do
What software or perl module can solve this?
  • Comment on What software/perl module should I use to make perl cgi script persistent

Replies are listed 'Best First'.
Re: What software/perl module should I use to make perl cgi script persistent
by Your Mother (Archbishop) on Apr 30, 2015 at 15:58 UTC

    Just to state more firmly what the previous reply implied. uWSGI absolutely does not need to recompile the script on each load; check the docs, as linked, and look for blog posts or example apps on github with deployment descriptions. There are plenty of options that don’t but I won’t mention them because I think uWSGI is better, by quite a lot, than the rest of the current crop.

Re: What software/perl module should I use to make perl cgi script persistent
by jeffa (Bishop) on Apr 30, 2015 at 17:17 UTC

    I always start my websites with Dancer2. Why? Because it provides virtually all the things i'll need later, like session handling. Consider the following:

    #!/usr/bin/env perl package App; use Dancer2; set session => 'YAML'; get '/' => sub { my $value = session( 'some.var' ) || 0; $value++; session 'some.var' => $value; return "The current value is $value"; }; start;

    The docs contain a complete working example for handling the logging in and out of user sessions as well: https://metacpan.org/pod/Dancer2::Manual#Sessions-and-logging-in

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re: What software/perl module should I use to make perl cgi script persistent
by Anonymous Monk on Apr 30, 2015 at 10:33 UTC