GROOVY-6914: Add optional caching template resolver