A resolver without a cacheKey would make resolvers with a cacheKey void, since the templateName is then put in the cache and found.

So now find the first template resolution to see if that's in the cache. And if not, go through the template resolutions till the template is resolved.

This feature should probably be put behind a configuration flag since it impacts performance.
Removed unused variable