Hosts often accelerate their reproductive effort in response to a parasitic infection, especially when their chances of future reproduction decrease with time from the onset of the infection. Because malignancies usually reduce survival, and hence potentially the fitness, it is expected that hosts with early cancer could have evolved to adjust their life‐history traits to maximize their immediate reproductive effort. Despite the potential importance of these plastic responses, little attention has been devoted to explore how cancers influence animal reproduction. Here, we use an experimental setup, a colony of genetically modified flies Drosophila melanogaster which develop colorectal cancer in the anterior gut, to show the role of cancer in altering life‐history traits. Specifically, we tested whether females adapt their reproductive strategy in response to harboring cancer. We found that flies with cancer reached the peak period of oviposition significantly earlier (i.e., 2 days) than healthy ones, while no difference in the length and extent of the fecundity peak was observed between the two groups of flies. Such compensatory responses to overcome the fitness‐limiting effect of cancer could explain the persistence of inherited cancer‐causing mutant alleles in the wild.