browserify-middleware icon indicating copy to clipboard operation
browserify-middleware copied to clipboard

Deferred or lazy precaching

Open calvinmetcalf opened this issue 8 years ago • 1 comments

Ok just spent a couple hours debuging a problem that turned out to be due to this module doing exactly that it claimed it would do.

Basically since the precaching is done on require this effectively delays server start up to the point that if I had a big enough bundle it would cause my server to fail a readiness probe.

I've fixed my problem by statically compiling my libs for production but the ability to lazy precache the bundle in production so waiting for it to cache only delays that one route would be super nifty.

calvinmetcalf avatar Feb 03 '16 22:02 calvinmetcalf

set precompile to false in the options, then it will compile the bundle only when it is first requested.

ForbesLindesay avatar Feb 04 '16 23:02 ForbesLindesay