In this chapter, we have covered several advanced concepts about caches. By now, you should be aware that you can greatly improve the performance of your application by caching read-only or read-mostly data. However, the cache can turn to a potential waste of memory and even a bottleneck when it's not used appropriately.
The following use case aims to show the rationale behind the choice of using or not using caches in your application.
Consider an application, which is a part of a Provisioning System managing network resources, which are planned to be allocated. In order to give to the end user a complete view of the network, the main panel displays the available resources in a tree, as displayed in the following image:
Since the network includes potentially hundreds of thousands resources, inner leaves are lazy loaded, when the user navigates across the tree.
The performance of the frontend GUI is however poor, since browsing through the nodes takes an average of 1.8 seconds...