Agile Web Development with Rails 7: Improvements to reloading description (Page 28)

@rubys

Two comments here:

It turns out that the Rails dispatcher is pretty clever. In development mode (as opposed to testing or production), it automatically reloads application source files when a new request comes along.

The way this is written, users could believe that happens on every request. I believe it would be clear to say that only happens when something has been edited (or files added or deleted).

However, this flexibility comes at a cost: it causes a short pause after you enter a URL before the application responds. That’s caused by the dispatcher reloading stuff. For development it’s a price worth paying, but in production it would be unacceptable. For this reason, this feature is disabled for production deployment.

This is confusing. Since in production nobody is editing and you do NOT reload per request, no reload penalty would be paid. Watching the file system is asynchronous by default, so no scanning or anything either.

In production reloading is disabled because you don’t need it, and by disabling you can save some RAM.

Also, in development mode users won’t notice any delay for the small applications written here, because reloading is only “unloading”, no source file is being executed again.

I believe the paragraph could be less alarming: This is convenient, may have a tiny penalty in very large applications but you will not notice most likely. In testing and in production this feature is disabled because you don’t edit the code.