A building or a bridge might collapse after a heat shock. This paper shows that a porous hierarchy of a coating can effectively prevent a building or a bridge from such damage. A cocoon’s geometrical structure is studied and its resistance to the heat shock is revealed by a thermal oscillator. The theoretical model reveals an extremely low frequency of the thermal oscillator, which is very important for cocoons’ biomechanism, especially in the heat insulation function. At the same time, it shows that the cocoons have the best thickness to protect the pupa from the environment. In addition, surface temperature measurement of hierarchical mulberry leaves is performed. This work provides new insights into biomimetic design of the protective building and coatings.