.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Mojolicious::Guides::FAQ 3pm" .TH Mojolicious::Guides::FAQ 3pm "2013-04-11" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Mojolicious::Guides::FAQ \- Frequently Asked Questions .SH "OVERVIEW" .IX Header "OVERVIEW" This document contains answers for the most frequently asked questions about Mojolicious. .SH "QUESTIONS" .IX Header "QUESTIONS" .SS "How does Mojolicious compare to other Perl web frameworks?" .IX Subsection "How does Mojolicious compare to other Perl web frameworks?" The short answer is \*(L"it doesn't\*(R", because we interpret the words \&\*(L"web framework\*(R" much more literally than others. With the emergence of the \&\f(CW\*(C`real\-time web\*(C'\fR and new technologies such as \f(CW\*(C`WebSockets\*(C'\fR, we are facing new challenges that go way beyond what commonly used modules like \s-1LWP\s0 were designed for. Because of this, Mojolicious contains a whole new \s-1HTTP\s0 client/server stack called Mojo, which was heavily inspired by the original \&\f(CW\*(C`LWPng\*(C'\fR effort and carefully designed with these new requirements in mind. So while some of the higher abstraction layers might look similar to other web frameworks, it actually defines a whole new category and could even be the foundation for more advanced ones in the future. .SS "Why doesn't Mojolicious have any dependencies?" .IX Subsection "Why doesn't Mojolicious have any dependencies?" We are optimizing Mojolicious for user-friendliness and development speed, without compromises. While there are no rules in Mojolicious::Guides::Contributing that forbid dependencies, we do currently discourage adding non-optional ones in favor of a faster and more painless installation process. And we do in fact already use several optional \s-1CPAN\s0 modules such as \s-1EV\s0, IO::Socket::IP, IO::Socket::SSL and Plack to provide advanced functionality if they are installed. .SS "Why reinvent wheels?" .IX Subsection "Why reinvent wheels?" Because we can make them rounder. Components specifically designed for user-friendliness and development speed are not easy to come by. We are strong believers of the Perl mantra \*(L"There is more than one way to do it\*(R", and our quest is to develop the best possible solutions for these two criteria. .SS "What about backwards compatibility?" .IX Subsection "What about backwards compatibility?" In conformance with Mojolicious::Guides::Contributing, we will always deprecate a feature before removing or changing it in incompatible ways between major releases. New features can however be marked as experimental to explicitly exclude them from these rules. This gives us the necessary freedom to ensure a healthy future for Mojolicious. So, as long as you are not using anything marked experimental, untested or undocumented, you can always count on backwards compatibility, everything else would be considered a bug. .SS "Why not split up Mojolicious into many smaller distributions?" .IX Subsection "Why not split up Mojolicious into many smaller distributions?" Because there are no advantages, it drastically increases maintenance costs and installation times without giving us anything in return. It would only make sense if we wanted to pass ownership of a module to a new maintainer, which we already have done in the past. .ie n .SS "What does the error ""Maximum message size exceeded"" mean?" .el .SS "What does the error ``Maximum message size exceeded'' mean?" .IX Subsection "What does the error Maximum message size exceeded mean?" To protect your applications from excessively large requests and responses, our \s-1HTTP\s0 parser has a cap after which it will automatically stop accepting new data, and in most cases force the connection to be closed. This limit is around \f(CW\*(C`5MB\*(C'\fR by default, you can use the \s-1MOJO_MAX_MESSAGE_SIZE\s0 environment variable to change this value. .ie n .SS "What does the error ""Maximum line size exceeded"" mean?" .el .SS "What does the error ``Maximum line size exceeded'' mean?" .IX Subsection "What does the error Maximum line size exceeded mean?" This is a very similar protection mechanism to the one described in the previous answer, but a little more specific. It limits the maximum length of any \f(CW\*(C`\ex0d\ex0a\*(C'\fR terminated part of a \s-1HTTP\s0 message, such as request line, status line and headers. This limit is around \f(CW\*(C`10KB\*(C'\fR by default, you can use the \s-1MOJO_MAX_LINE_SIZE\s0 environment variable to change this value. .ie n .SS "What does the error ""Maximum buffer size exceeded"" mean?" .el .SS "What does the error ``Maximum buffer size exceeded'' mean?" .IX Subsection "What does the error Maximum buffer size exceeded mean?" This protection mechanism is very similar to those mentioned in the two previous answers. It limits how much content the \s-1HTTP\s0 parser is allowed to buffer when parsing chunked, compressed and multipart messages. This limit is around \f(CW\*(C`256KB\*(C'\fR by default, you can use the \s-1MOJO_MAX_BUFFER_SIZE\s0 environment variable to change this value. .ie n .SS "What does the error ""\s-1EV\s0 does not work with ithreads"" mean?" .el .SS "What does the error ``\s-1EV\s0 does not work with ithreads'' mean?" .IX Subsection "What does the error EV does not work with ithreads mean?" The Mojolicious user agent and web servers are based on an event loop that supports multiple reactor backends. One of these backends is \s-1EV\s0, it is very fast and will be automatically used if installed. On Windows however, the \&\f(CW\*(C`ithreads\*(C'\fR based \f(CW\*(C`fork()\*(C'\fR emulation can interfere with it, and you may have to use the \s-1MOJO_REACTOR\s0 environment variable to enforce a more portable one. .PP .Vb 1 \& MOJO_REACTOR=Mojo::Reactor::Poll .Ve .ie n .SS "What does ""Your secret passphrase needs to be changed"" mean?" .el .SS "What does ``Your secret passphrase needs to be changed'' mean?" .IX Subsection "What does Your secret passphrase needs to be changed mean?" Mojolicious uses a secret passphrase for security features such as signed cookies. It defaults to the name of your application, which is not very secure, so we added this log message as a reminder. You can change the passphrase with the attribute \*(L"secret\*(R" in Mojolicious. .PP .Vb 1 \& app\->secret(\*(AqMy very secret passphrase.\*(Aq); .Ve .ie n .SS "What does ""Nothing has been rendered, expecting delayed response"" mean?" .el .SS "What does ``Nothing has been rendered, expecting delayed response'' mean?" .IX Subsection "What does Nothing has been rendered, expecting delayed response mean?" Mojolicious has been designed from the ground up for non-blocking I/O and event loops. So when a new request comes in and no response is generated right away, it will assume that this was intentional and return control to the web server, which can then handle other requests while waiting for events such as timers to finally generate a response. .ie n .SS "What does ""Inactivity timeout"" mean?" .el .SS "What does ``Inactivity timeout'' mean?" .IX Subsection "What does Inactivity timeout mean?" To protect your applications from denial-of-service attacks, all connections have an inactivity timeout which limits how long a connection may be inactive before being closed automatically. It defaults to \f(CW20\fR seconds for the user agent and \f(CW15\fR seconds for all built-in web servers, and is commonly referred to as \f(CW\*(C`inactivity_timeout\*(C'\fR. This timeout always applies, so you might have to tweak it for applications that take a long time to process a request. .ie n .SS "What does ""Premature connection close"" mean?" .el .SS "What does ``Premature connection close'' mean?" .IX Subsection "What does Premature connection close mean?" This error message is often related to the one above, and means that the web server closed the connection before the user agent could receive the whole response. .ie n .SS "What does ""Worker 31842 has no heartbeat, restarting"" mean?" .el .SS "What does ``Worker 31842 has no heartbeat, restarting'' mean?" .IX Subsection "What does Worker 31842 has no heartbeat, restarting mean?" As long as they are accepting new connections, Hypnotoad worker processes send heartbeat messages to the manager process at regular intervals, to signal that they are still responsive. A blocking operation such as an infinite loop in your application (or active connections after a worker has stopped accepting new connections) can prevent this, and will force the affected worker to be restarted after a timeout. This \f(CW\*(C`heartbeat_timeout\*(C'\fR defaults to \f(CW20\fR seconds and can be extended if your application requires it. .SH "MORE" .IX Header "MORE" You can continue with Mojolicious::Guides now or take a look at the Mojolicious wiki , which contains a lot more documentation and examples by many different authors. .SH "SUPPORT" .IX Header "SUPPORT" If you have any questions the documentation might not yet answer, don't hesitate to ask on the mailing-list or the official \s-1IRC\s0 channel \f(CW\*(C`#mojo\*(C'\fR on \f(CW\*(C`irc.perl.org\*(C'\fR.