refactor($templateRequest): avoid double calls to $templateCache.put

Closes #10265