Once in the cache, does Thymeleaf optimize processing of DOM subtrees that have no processing need? In other words, will it short circuit its recursive processing and move to the next sibling or parent if there are no dialects applied?
AFAIK, caching just saves having to request a template from the TemplateResolver (which is the interface that loads a template from the servlet context / classloader / file system / database / whatever), creating a DOM of that template once, then just serving that preconstructed DOM every time the template is requested by the user, dialects, or by other Thymeleaf internals.
Saving processing time by skipping 'no-processing-required' DOM nodes in the template is an interesting idea for a performance optimization. If that isn't already in the todo list, I might want to create an enhancement for the idea :)
Of course, this "skippable" flag might be modified at runtime because some processors might create new attributes or nodes in the DOM, and therefore the processors that should be applied to these attributes or nodes would have to be recomputed agan (that's why the "recomputeProcessorsImmediately" and "recomputeProcessorsAfterEachExecution" exist at the Node class).