4. In the right triangular prism $A_{1} B_{1} C_{1}-A B C$, $\angle B A C = \frac{\pi}{2}, A B = A C = A A_{1} = 1$. Given that $G$ and $E$ are the midpoints of $A_{1} B_{1}$ and $C C_{1}$ respectively, and $D$ and $F$ are moving points on segments $A C$ and $A B$ (excluding the endpoints). If $G D \perp E F$, then the range of the length of segment $D F$ is ( ).
(A) $\left[\frac{1}{\sqrt{5}}, 1\right)$
(B) $\left[\frac{1}{5}, 2\right)$
(C) $[1, \sqrt{2})$
(D) $\left[\frac{\sqrt{5}}{5}, \sqrt{2}\right)$