Skip to content

Caching partial templates #116

@Gohla

Description

@Gohla

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions