Can you please tell me if it's possible to build the assets on demand in production mode, rather than building them each time the server starts? With the default settings, my node server has to build the assets after each server crash and takes a lot of time.
I've recently became maintainer of connect-assets, and am trying to take care of the open pulls/issues. Please check the game plan.
Regarding your question, I don't believe there is a way to prevent connect-assets from building on startup in production. I think the idea was to prevent the first request from taking forever.
If your assets are compiled on first request, won't the same problem still be there, except now a user of your site will be waiting?
I would fix the server crash.
Yeah, fixing is what we always do. But recently we had unexpected errors coming from external services (like mongo and redis) and it takes a while to deal with them in production.
Anyway, the idea was to not recompile the assets at each server restart unless they have changed or at least to disable the automatic recompilation and trigger it manually when needed.
Thanks for you support.
Just so I can get a grip over how critical this issue is to you, how much time are we talking about?
Possibly related to #163.
It's not extremely critical. The workaround I found is to immediately hit the root URL of the app with a cURL request after each server restart triggered by Upstart, Monit or Forever.
Glad to hear you got a workaround though. There's quite a bit of discussion around this on #164; feel free to chime in on if the proposed solutions would work for you.