diff --git a/src/main/java/org/thymeleaf/engine/TemplateManager.java b/src/main/java/org/thymeleaf/engine/TemplateManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/thymeleaf/engine/TemplateManager.java
+++ b/src/main/java/org/thymeleaf/engine/TemplateManager.java
@@ -579,6 +579,13 @@ public final class TemplateManager {
                     "any of the configured Template Resolvers");
         }
 
+        if (!template.equals(templateResolution.getTemplate())) {
+            throw new TemplateInputException(
+                    "One of the Template Resolvers has tried to change the template name, which is forbidden as it " +
+                    "could provoke issues such as cache inconsistencies (template was asked as \"" + template + "\" " +
+                    "but resolved as \"" + templateResolution.getTemplate() + "\")");
+        }
+
         return new Resolution(templateResolution, templateResource);
 
     }
Added a check at TemplateManager making sure that template names are not changed during template resolution