fix(cache): elements in templates must also be considered