I have built a reusable vertical navigation Lightning Component, and plan to have multiple pages separating large forms, which the component will link to individually. However, if it were possible, it may be more ideal to load the Lightning Components that would be found on the other pages, into the existing page, as to reduce page loads and improve UI responsiveness.

If I went the path of unloading and loading components individually, how would one go about doing this? Does anyone know of any tutorials, articles, or have any examples on how one might dynamically unload (as in the case that the "page" has been move from) and load new components?


Aura, Lightning's runtime, already includes caching capabilities. There's probably not any need to be more aggressive than the default setup, because it might invalidate items in the cache that you didn't mean to, since the cache has a limited amount of space/memory. If you wanted to experiment, you could create a component that has all the other components in it, and then create that component via $A.createComponent initially. This will fill up the cache with all of the components you're interested in loading from the server in to the cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.