In a recent paper [Gorshkov et al., Phys. Rev. Lett. 98, 123601 (2007)], we

used a universal physical picture to optimize and demonstrate equivalence

between a wide range of techniques for storage and retrieval of photon wave

packets in Lambda-type atomic media in free space, including the adiabatic

reduction of the photon group velocity, pulse-propagation control via

off-resonant Raman techniques, and photon-echo-based techniques. In the present

paper, we perform the same analysis for the cavity model. In particular, we

show that the retrieval efficiency is equal to C/(1+C) independent of the

retrieval technique, where C is the cooperativity parameter. We also derive the

optimal strategy for storage and, in particular, demonstrate that at any

detuning one can store, with the optimal efficiency of C/(1+C), any smooth

input mode satisfying T C gamma >> 1 and a certain class of resonant input

modes satisfying T C gamma ~ 1, where T is the duration of the input mode and 2

gamma is the transition linewidth. In the two subsequent papers of the series,

we present the full analysis of the free-space model and discuss the effects of

inhomogeneous broadening on photon storage.