Skip to content
Julian Knight edited this page Nov 5, 2017 · 8 revisions

One issue with the design uibuilder uses is that, when someone loads a new instance of the front-end, it won't receive any previous messages. This is especially problematic for dashboards. This happens when a user reloads a page as well, all of the dynamic data is lost.

In addition the front-end page is not always ready (or even loaded) when messages are already being received by the node instance.

To combat these issues, we need to somehow cache incoming messages and play them forwards to any new client (or one that is reloaded).

You can either handle this manually or better still, use the companion node node-red-contrib-infocache. Simply send the control messages from the uibuilder instance to the input of an infocache node and it will resend all cached messages back to the individual client when the client is ready to deal with them.

By default, this will happen when the window.load event fires. But if you are using a front-end library like Riot, Vue, etc. you can override this by setting uibuilder.autoSendReady(false) and then use uibuilder.sendCtrl({'type':'ready for content', 'cache-control':'REPLAY'}) when your app is ready for content (e.g. perhaps at the end of the app.mounted event).

Clone this wiki locally