Open williamthome opened 3 months ago
Another option is to compile the template into a new module via the Erlang compile module. Zotonic uses this approach in its template_compiler.
Another one is to use ct_expand, which expands the result at the compile time.
We had an attempt to speed up the render of the templates by storing it in
persistent_term
here, but it was not working as expected, as related in #135. Maybe a module that holds an ETS table could be implemented to keep them in memory.The current flow is:
scanned
,parsed
,compiled
, and, finally,rendered
scanned
,parsed
,compiled
, and, finally,rendered
In steps 3 and 6, we should be able to just fetch and render the compiled template.
Suggestions welcome.