ozimov / spring-boot-email-tools

A set of services and tools for sending emails in a Spring Boot 1.5.x application using a Template Engine
Apache License 2.0
194 stars 96 forks source link

Add template pre-evaluation #13

Open robertotru opened 7 years ago

robertotru commented 7 years ago

Currently the email with template are scheduled and compiled through the template engine when they need to be sent. However, this may affect the response time when thousands email need to be executed simultaneously. Therefore, it could be a good idea to start compiling the templates in advance when the burden is lower.

msauza commented 7 years ago

Template pre-evaluation depends on every used engine, e. g. freemarker has template cache by default. If all engines implements the same mechanism, maybe on bean could process templates post-init.

Meanwhile using freemarker ensure that template loading and evaluation happen once until it got modified.

robertotru commented 7 years ago

I mean. What if a template is conveted to html immediately when the machine burden is low or there is available computer power? One could save some time and memory: a big String instead of storing the template plus model object. Anyway I am still not sure about this story.