Blazars are characterized by large amplitude and rapid variability, indicat
ing that the electron distribution is changing rapidly, often on time-scale
s shorter than the light-crossing time. The emitting region is sufficiently
compact to let radiative losses dominate the cooling of high-energy electr
ons. We study the time-dependent behaviour of the electron distribution aft
er episodic electron injection phases, and calculate the observed synchrotr
on and self-Compton radiation spectra. Since photons produced in different
parts of the source have different travel times, the observed spectrum is p
roduced by the electron distribution at different stages of evolution. Even
a homogeneous source then resembles an inhomogeneous one. Time delays betw
een the light curves of fluxes at different frequencies are possible, as il
lustrated for the specific case of the BL Lac object Mrk 421.