I am having a real difficult to counting degree of freedom. In fact, I notice that sometimes I am confused about what exactly we count as DoF, and what we do not count.
See, for example, the electromagnetic field. The potential has a gauge symmetry
$$\partial_{\mu} A^{\mu} = 0$$
Now, initially, in $d=4$, this potential has $4$ dof, but the gauge symmetry (1 eq) decrease it by 1, so we have $3$ now. If we study the equations of motion, we will see the further condition for massless particles
$$\epsilon_{\mu} k^{\mu} = 0$$
Which restrict even more the dof, so we have 2 now. Ok. What is confusing me is that, sometimes, I have seen people (see for example asperanz's answer here) using the diffeomorphism of the spacetime to restrict the dof as well, and this is confusing me. How can it restrict something? I mean, if so, $A_{\mu}$ has 4 transformation ($\mu = 0,...3$) and has no dof?