We study the star formation quenching mechanism in cluster galaxies by fitting the spectral energy distribution (SED) of the Herschel Reference Survey, a complete volume-limited K-band-selected sample of nearby galaxies including objects in different density regions, from the core of the Virgo cluster to the general field. The SEDs of the target galaxies were fitted using the CIGALE SED modelling code. The truncated activity of cluster galaxies was parametrised using a specific star formation history with two free parameters, the quenching age QA and the quenching factor QF. These two parameters are crucial for the identification of the quenching mechanism, which acts on long timescales when starvation processes are at work, but is rapid and efficient when ram pressure occurs. To be sensitive to an abrupt and recent variation of the star formation activity, we combined twenty photometric bands in the UV to far-infrared in a new way with three age-sensitive Balmer line absorption indices extracted from available medium-resolution (R ∼ 1000) integrated spectroscopy and with Hα narrow-band imaging data. The use of a truncated star formation history significantly increases the quality of the fit in HI-deficient galaxies of the sample, that is to say, in those objects whose atomic gas content has been removed during the interaction with the hostile cluster environment. The typical quenching age of the perturbed late-type galaxies is QA < ∼ 300 Myr whenever the activity of star formation is reduced by 50% < QF ≤ 80% and QA < ∼ 500 Myr for QF > 80%, while that of the quiescent early-type objects is QA 1−3 Gyr. The fraction of late-type galaxies with a star formation activity reduced by QF > 80% and with an HI-deficiency parameter HI − de f > 0.4 drops by a factor of ∼5 from the inner half virial radius of the Virgo cluster (R/R vir < 0.5), where the hot diffuse X-ray emitting gas of the cluster is located, to the outer regions (R/R vir > 4). The efficient quenching of the star formation activity observed in Virgo suggests that the dominant stripping process is ram pressure. We discuss the implication of this result in the cosmological context of galaxy evolution.