In this paper, we proposed a cavity containing colloidal ferrofluids to enhance the Goos-Hänchen (GH) shifts of reflected and transmitted light beams. By optimizing the parameters of the cavity, the resonance inside the cavity was strengthened, and we obtained huge GH shifts. Magnetocontrolled negative GH shifts have been also analyzed. We found that a suitable cavity with optimized structural parameters can enhance the effect of the GH shifts on ferrofluids, which have an extremely small volume parameter and a small shell thickness parameter....