web: optimize `flush`