add config support for enabling/disabling in memory template caching