Add caching support for templates and helper methods