Build assets on demand #157

doomhz opened this Issue Feb 20, 2013 · 7 comments


None yet
3 participants

doomhz commented Feb 20, 2013


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.

Thank you.


adunkman commented Feb 23, 2013


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?

adunkman was assigned Feb 23, 2013

I would fix the server crash.

doomhz commented Feb 23, 2013

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.


adunkman commented Feb 23, 2013

Just so I can get a grip over how critical this issue is to you, how much time are we talking about?


adunkman commented Feb 23, 2013

Possibly related to #163.

doomhz commented Feb 23, 2013

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.


adunkman commented Feb 24, 2013

Gross! :)

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.

adunkman closed this Feb 24, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment