src/Sulu/Bundle/AudienceTargetingBundle/EventListener/TargetGroupSubscriber.php
public function addVaryHeader(FilterResponseEvent $event)
    {
        $request = $event->getRequest();
        $response = $event->getResponse();

        if ($this->targetGroupStore->hasInfluencedContent() && $request->getRequestUri() !== $this->targetGroupUrl) {
            $response->setVary($this->targetGroupHeader, false);
        }
    }
public function addVaryHeader(FilterResponseEvent $event)
    {
        $request = $event->getRequest();
        $response = $event->getResponse();

        if ($this->targetGroupStore->hasInfluencedContent() && $request->getRequestUri() !== $this->targetGroupUrl) {
            $response->setVary($this->targetGroupHeader, false);
        }
    }
public function addVaryHeader ( FilterResponseEvent $ event ) { $ request = $ event -> getRequest ( ) ; $ response = $ event -> getResponse ( ) ; if ( $ this -> targetGroupStore -> hasInfluencedContent ( ) && $ request -> getRequestUri ( ) !== $ this -> targetGroupUrl ) { $ response -> setVary ( $ this -> targetGroupHeader , false ) ; } }
Adds the vary header on the response, so that the cache takes the target group into account.

@param FilterResponseEvent $event
Adds the vary header on the response so that the cache takes the target group into account .