wilkinsona / project-generator

3 stars 4 forks source link

Enable template caching #73

Closed snicoll closed 5 years ago

snicoll commented 5 years ago

Our TemplateRenderer abstraction has a single mustache implementation for now. Templates are compiled and rendered every single time a project requests content.

The compiled template should be cached at a bare minimum. We should also consider caching the output if we can.

To enable this, we need to be able to provide a Cache to MustacheTemplateRenderer and change it in such a way that it can compute unique keys for a given template source. I am not keen to expose that to the caller so we should have some sort of factory object to create the template renderer, something similar to IndentWriterFactory perhaps?