Can a Event Service be coupled to a route
If you want to restrict the event subscriber to a route then check for the route name:

public function onResponse(FilterResponseEvent $event) {

  $route_name = $event-&gt;getRequest()-&gt;attributes-&gt;get('_route');
  if ($route_name !== 'my.route.name') {
    return;
  }

  ...

}


Although in Drupal it might be best practice to get the route name from the current_route_match service:

$route_name = $this-&gt;routeMatch-&gt;getRouteName();


which you then need to inject in the event subscriber.