pupeno/prerenderer

Mark the server side as done

pupeno opened this issue · 2 comments

It would be easy to have NodeJS listening on an async.core channel for a "we are done" message to trigger early termination of pre-rendering and thus shipping of the page to the user.

What I'm not sure if it'll be easy or even possible is to have the application send that message.

Hi

This is hypothetical and is based on the way I structure my apps. It is similar to what I have seen from other people, and as far as I can tell to your example in ninjatools...

For some applications it would not be hard to dispatch message [:data-ready ...] for each page after all the data is fetched for the page. This could be used to short circuit waiting for timeout. After all the data is ready we just need to wait for render once more (maybe reagent force-update-all would help?)

Yes, that is correct. My plan is to have a series of heuristics and you can mix and match according to your app, timeout being the fallback. You can have an event trigger the end, you can have the lack of queue events (plus pending ajax requests) trigger the end, etc.