Compensatory endocytosis keeps the membrane surface area of secretory cells constant following exocytosis. At chemical synapses, clathrin-independent ultrafast endocytosis maintains such homeostasis. This endocytic pathway is temporally and spatially coupled to exocytosis; it initiates within 50 ms at the region immediately next to the active zone where vesicles fuse. However, the coupling mechanism is unknown. Here, we demonstrate that filamentous actin is organized as a ring, surrounding the active zone at mouse hippocampal synapses. Assuming the membrane area conservation is due to this actin ring, our theoretical model suggests that flattening of fused vesicles exerts lateral compression in the plasma membrane, resulting in rapid formation of endocytic pits at the border between the active zone and the surrounding actin-enriched region. Consistent with model predictions, our data show that ultrafast endocytosis requires sufficient compression by exocytosis of multiple vesicles and does not initiate when actin organization is disrupted, either pharmacologically or by ablation of the actin-binding protein Epsin1. Our work suggests that membrane mechanics underlie the rapid coupling of exocytosis to endocytosis at synapses.