TemplateCache is detailed implementation information (I assume it is publicly available because Java does not allow it to be seen only for FreeMarker packages). The best question is why you cannot get CacheStorage from Configuration . In any case, even FreeMarker does not know the list of templates with your problem, because the CacheStorage interface CacheStorage not provide any method for requesting. However, you can connect your own implementation of CacheStorage through Configuration.setCacheStorage , which provides such a method and stores a link to it somewhere outside of FreeMarker. Yes, itβs awkward that you cannot just get it from Configuration ... But on the bright side, you can control the cache activity as you like.
Update: FreeMarker 2.3.20 has Configuration.getCacheStorage() , so it no longer hides.
source share