backport reduced clearCompiledTemplate call