How the inverse square law in electrodynamics is related to photon mass?

I have read somewhere that one of the tests of the inverse square law is to assume nonzero mass for photon and then, by finding a maximum limit for it , determine a maximum possible error in $\frac{1}{r^{2+\epsilon} }$ for $\epsilon$ . My question is: (in the context of classical physics)

• How are these two related and what is the formula relating them?

• Why measuring photon mass is easier than testing the inverse square law directly? (Indeed it seems more challenging!)

However, if you accept that electromagnetic field is described by some local quadratic Lagrangian, then I believe that the fact that photon posseses some mass $m$ would imply for the potential something like: $$\phi\propto \frac{e^{-mr}}{r},$$ in units where $\hbar=c=1$. It is the Yukawa potential. Well, may be for EM it is a liitle bit different, but the point is that there is some exponential decay. There is an intuitive explanation for this fact: a virtual photon of mass $m$ can exist only for a time about $1/m$ so that it can propagate to a distance $1/m$. This means that the range of the EM intraction will be about $1/m$ ($\hbar/mc$ in usual units).