in reply to Re^3: Best practices: Generating HTML content
in thread Best practices: Generating HTML content

Thanks 1nickt,

I only meant im-memory caching during the application lifetime. Not between runs (that's for sure not what one wants to do in a module).

Upon reading your reply, I rushed to revisit my code that dealt with caching scalar reference templates. What I found there was exactly my $compiled = $tt->template(\$in_memory); sequence - at which I arrived after trying to utilize Template::Provider.

So caching compiled templates is indeed simple. It's just not quite obvious from documentation. And the possible speed penalty is a pitfall that's worth mentioning.

  • Comment on Re^4: Best practices: Generating HTML content