All-Optical switching in photonic crystal waveguide-cavity structures is studied predominantly theoretically and numerically, but also from an experimental point of view. We have calculated the first order perturbations to the resonance frequency and decay rate of cavity modes, using a mathematical framework that correctly takes into account the leaky nature of these modes. This represents the foundation for including nonlinearities into the temporal coupled mode theory, which is widely used to model the cavity-waveguide dynamics. In the experimental part of the thesis, we have considered both homodyne and heterodyne measurements of the cavity dynamics, as well as a comparison with the model developed from the perturbation theory mentioned above. The model was seen to provide a qualitative agreement with the experiments indicating that the relevant physical mechanisms are accounted for by the model. A considerable effort has been put into designing advanced structures with increased flexibility and the ability to avoid some of the difficulties in terms of experimental investigations mentioned above. This has resulted in e.g. the four port device, where the signal and pump are spatially separated. This device was fabricated and characterized by colleagues within the group, and it was shown to perform very well in terms of cross-talk between the signal and pump. Theoretical investigations as well as practical design proposals have resulted from a study of waveguide-cavity structures exhibiting Fano resonances. These devices were predicted to be superior to structures with the more well-known Lorentzian line shape in terms of energy consumption and switching contrast. Finally, the mathematical framework of optimal control theory was employed as a general setting, in which the optical properties of the input fields may be tailored to optimize various objectives, such as the cavity energy. A particular example showed how to adjust the amplitude and phase of the pump field to maximize the cavity energy in a given time interval. The results also revealed how to extract the cavity energy faster than the photon lifetime by utilizing interference effects.