The synapse is typically viewed as a single compartment, which acts as a linear gain controller on incoming input. Traditional plasticity rules enable this gain control to be dynamically optimized by Hebbian activity. Whilst this view nicely captures postsynaptic function, it neglects the non-linear dynamics of presynaptic function. Here we present a two-compartment model of the synapse in which the presynaptic terminal first acts to filter presynaptic input before the postsynaptic terminal, acting as a gain controller, amplifies or depresses transmission. We argue that both compartments are equipped with distinct plasticity rules to enable them to optimally adapt synaptic transmission to the statistics of pre- and postsynaptic activity. Specifically, we focus on how presynaptic plasticity enables presynaptic filtering to be optimally tuned to only transmit information relevant for postsynaptic firing. We end by discussing the advantages of having a presynaptic filter and propose future work to explore presynaptic function and plasticity in vivo.