The development of high-performance CO2 electrolyzers is crucial for accelerating the sustainable production of fuels and chemicals integrated with renewable energy sources. Here, we introduce a methodology to actively control mass transport inside a realistic zero-gap membrane electrode assembly of a CO2 electrolyzer by varying the gasket thickness, which consequently changes the cell compression. This allows control over the thickness and porosity of the gas diffusion electrodes, influencing the overall electrolyzer performance, as demonstrated using Ag-deposited electrodes. At low operating voltages (<2.9 V), both high- and low-compression electrolyzers exhibit similar faradaic efficiencies and partial current densities for CO formation. However, at high voltages, the low-compression electrolyzer with high electrode porosity demonstrates superior CO selectivity and activity with suppressed H2 formation. These experimental results are validated by the computational membrane electrode assembly (MEA) model developed by using the measured in situ electrode thicknesses and electrode porosities. Additionally, liquid electrolyte saturation at the catalyst layer is found to play a dominant role in determining the mass transport, resulting in a decreased electrolyzer performance with low electrode porosity. The systematic investigation in this study improves the understanding of the transport dynamics in MEA-based devices and provides insights into optimizing device design parameters for industry-relevant CO2 electrolysis.