I am unable to understand why the gauge field must be periodic along the compactified direction in finite temperature field theory. I get that whatever quantity that is measurable and gauge invariant along that direction must be periodic. But that means that the gauge field must be periodic only upto a gauge transformation and not strictly periodic. This is actually the condition used by 't Hooft when formulating gauge theory on $T^4$, where all the four directions are compactified. So, why is the condition different when one direction is compactified?
In terms of equations, I'm saying that the boundary condition must be $$A_{\mu}(\vec{x},\tau + \beta)=\omega A_{\mu}(\vec{x},\tau)\omega^{-1}+\omega\partial_{\mu}\omega^{-1}$$ instead of $$A_{\mu}(\vec{x},\tau +\beta)=A_{\mu}(\vec{x},\tau)$$ where $\omega$ belongs to the gauge group under consideration, say $SU(2)$. It would be great if someone could help me clear up this confusion.
For reference, I am studying from the paper by Harrington and Shepard called "Periodic Euclidean solution and finite temperature Yang-Mills gas". They also have another paper called "Euclidean solutions and finite temperature gauge theory" that talks about this aspect more.