We show that the Hamiltonian action satisfies the Palais-Smale condition over a mixed regularity space of loops in cotangent bundles, namely the space of loops with regularity $H^s$, $sin (frac 12, 1)$, in the base and $H^{1-s}$ in the fiber direction. As an application, we give a simplified proof of a theorem of Hofer-Viterbo on the existence of closed characteristic leaves for certain contact type hypersufaces in cotangent bundles.