We present all-optical tuning and switching of a microcavity inside a two-dimensional photonic crystal waveguide. The photonic crystal structure is fabricated in silicon-on-insulator using complementary metal-oxide semiconductor processing techniques based on deep ultraviolet lithography and is completely buried in a silicon dioxide cladding that provides protection from the environment. By focusing a laser onto the micro cavity region, both a thermal and a plasma dispersion effect are generated, allowing tuning and fast modulation of the in-plane transmission. By means of the temporal characteristics of the in-plane transmission, we experimentally identify a slower thermal and a fast plasma dispersion effect with modulation bandwidths of the order of several 100 kHz and up to the gigahertz level, respectively.