Within the gauge symmetry framework, the U1U1 symmetry of electrodynamics is violated in the presence of gravity with spacetime translational gauge symmetry in inertial frames. For a light ray, an eikonal equation with effective metric tensors is derived in the geometric-optics limit. Under these conditions, the angle of the deflection of light by the sun is calculated to be δϕ≈1.75″ in inertial frames without requiring a gauge condition such as ∂μAμ=0. In contrast, if the theory is U1 gauge invariant, one can impose the gauge condition ∂μAμ=0 in the derivation of the eikonal equation. In this case, one obtains a slightly different effective metric tensor and a different angle of deflection δϕ≈1.52″. However, because the precision of experiments in the last century using optical frequencies has been no better than (10–20)% due to large systematic errors, one cannot unambiguously rule out the result δϕ≈1.52′. We hope that the precision of these data can be improved in order to test Yang–Mills gravity.