Blizzard updates the aura header anytime it is shown, it receives a UNIT_AURA event, or an attribute is assigned to it.
When setting a number of attributes in the header you can minimize the number of times Blizzard updates the header by setting the "_ignore" attribute first (or you can hide the header since the OnAttributeChanged script also ignores attribute updates when the header is not visible).
As long as the "_ignore" attribute is set, Blizzard will not update the header. When you're finished changing attributes, restore the original "_ignore" attribute value. To force a header update you can then set any other attribute.
Code:
local oldIgnore = header:GetAttribute("_ignore");
header:SetAttribute("_ignore", "attributeChanges");
-- Set all your header attributes here
header:SetAttribute("_ignore", oldIgnore);
header:SetAttribute("_update", header:GetAttribute("_update"));