MDL-68677 core: Correct usage of templaterev for caching templates