Reusing the GUI XML from GUI.XmlLoader.loadLayout()

I am using the GUI XmlLoader to load a large number of gui layouts with identical XML markup (using {{ }} placeholders). How can I make a single HTTP request using loadLayout() and not many requests?
Basically I want to cache the XML and reuse it.
Thanks,
Michael

cc @null

Hey Michael,

If you want to reuse the same layout, you can load the layout once, store the object globally and access it.

The loadLayout method is not meant to cache the GUI even if identical since you may want it to have different values for your UI elements.

The Xml however is needed only to generate the Babylon.js GUI elements so there is no need to cache it at all.

1 Like