Cuprate materials hosting high-temperature superconductivity (HTS) also exhibit various forms of charge and/or spin ordering whose significance is not fully understood. To date, static charge-density waves (CDWs) have been detected by diffraction probes only at special doping or in an applied external field. However, dynamic CDWs may also be present more broadly and their detection, characterization and relationship with HTS remain open problems. Here, we present a new method, based on ultrafast spectroscopy, to detect the presence and measure the lifetimes of CDW fluctuations in cuprates. In an underdoped La1.9Sr0.1CuO4 film (Tc = 26 K), we observe collective excitations of CDW that persist up to 100 K. This dynamic CDW fluctuates with a characteristic lifetime of 2 ps at T = 5 K which decreases to 0.5 ps at T = 100 K. In contrast, in an optimally doped La1.84Sr0.16CuO4 film (Tc = 38.5 K), we detect no signatures of fluctuating CDWs at any temperature, favoring the competition scenario. This work forges a path for studying fluctuating order parameters in various superconductors and other materials.