  We investigate the potential of gravitational-wave background searches to
constrain cosmic histories characterised by a stiff equation of state, preceded
by a period of matter domination. Such a scenario leads to a characteristic
peak in the primordial gravitational-wave spectrum originating from
cosmological inflation. Assuming instant transitions between distinct epochs,
which allows an analytical treatment of the gravitational-wave spectrum, we
perform a Bayesian inference analysis to derive constraints from the first
three observing runs of the LIGO-Virgo-KAGRA Collaboration. Additionally, we
consider a smooth transition, employing an axion-like particle physics model,
and highlight the difference with the instant transition approximation. We then
forecast detection prospects for such a cosmic history through future
gravitational-wave experiments.
