Hi @H_Malhotra
What is the exact use case you have where you want to implement Sling model caching?
As per Sling documentation, By default, Sling Models do not do any caching of the adaptation result and every request for a model class will result in a new instance of the model class.
In general, it is strongly discouraged to store a reference to the original adaptable using the self injector. Using implementation version 1.4.8 or below, storing the original adaptable in a Sling Model, can cause heap space exhaustion, crashing the JVM. Starting in version 1.4.10, storing the original adaptable will not crash the JVM, but it can cause unexpected behavior (e.g. a model being created twice, when it should be cached). The issue was first reported in SLING-7586.
More details here:
https://sling.apache.org/documentation/bundles/models.html#caching
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/sling-models-caching-use-c...
https://github.com/adobe/asset-share-commons/issues/177
Also here you do not have invalidate the cache as it's not cached in dispatcher.
Thanks!