The dynamics of a distributed Bragg reflector laser with optical losses in the Bragg section is studied in detail. It is found that the modulation response depends not only on the detuning of the lasing wavelength from the Bragg reflectivity peak but also on the magnitude of the waveguide losses in the Bragg section. Depending on the losses, the damping of the relaxation peak can either increase or decrease when the laser is detuned on the long wavelength flank of the Bragg peak. Hence, in order to achieve maximum modulation bandwidth of the laser, the laser needs not only to have the correct detuning but also an optimized waveguide loss in the Bragg section. The physical reason for this dependence is discussed in terms of a modified rate equation model.