Partial templates can be provided with a TemplateLoader. However, TemplateLoader.getTemplate returns a Reader instead of a Template, meaning that every time a partial is used, it is recompiled into a Template, which incurs extra overhead. I don't see a nice way to cache these partial templates with the current code (but I could be wrong).
As a workaround, I currently subclass Mustache.Compiler and add caching behavior. However, because Mustache.Delims is protected, this subclass must live under the com.samskivert.mustache package, and split packages are not allowed in Java 9 or higher.
Is there a nicer way to implement this caching behavior?
Partial templates can be provided with a
TemplateLoader. However,TemplateLoader.getTemplatereturns aReaderinstead of aTemplate, meaning that every time a partial is used, it is recompiled into aTemplate, which incurs extra overhead. I don't see a nice way to cache these partial templates with the current code (but I could be wrong).As a workaround, I currently subclass
Mustache.Compilerand add caching behavior. However, becauseMustache.Delimsisprotected, this subclass must live under thecom.samskivert.mustachepackage, and split packages are not allowed in Java 9 or higher.Is there a nicer way to implement this caching behavior?