The impact of solid and liquid objects (projectiles) onto liquids and soft solids (targets) generally results on the creation and expansion of an air cavity inside the impacted objects. The dynamics of cavity expansion and collapse depends on the projectile inertia as well as on the target properties.In this paper we study the impact of microfluidic jets generated by thermocavitation processes on a capillary bridge between two parallel planar walls. Different capillary bridge types were studied, Newtonian liquids, viscoelastic liquids and agarose gels. Thus, we compare the cavity formation and collapse between a wide range of material properties. Moreover, we model the critical impact velocity for a jet to traverse a capillary bridge type. Our results show that agarose gels with a storage modulus lower that 176 Pa can be modelled as a liquid for this transition. However, the predicted transition deviates for agarose gels with higher storage modulus. Additionally, we show different types of cavity collapse, depending on the Weber number and the capillary bridge properties. We conclude that the type of collapse determines the number and size of entrained bubbles. Furthermore, we study the effects of wettability on the adhesion forces and contact line dissipation. We conclude that upon cavity collapse, for hydrophobic walls a Worthington jet is energetically favourable. In contrast, for hydrophilic walls, the contact line dissipation is in the same order of magnitude of the energy of the impacted jet, suppressing the Worthington jet formation. Our results provide strategies for preventing bubble entrapment and give an estimation of the cavity dynamics for needle-free injection applications and additive manufacturing among other applications.