public function tagUserContext(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        if (!$response->isCacheable()) {
            return;
        }

        if ($response->headers->get('Content-Type') !== 'application/vnd.fos.user-context-hash') {
            return;
        }

        if (!$response->getTtl()) {
            return;
        }

        // We need to set tag directly on repsonse here to make sure this does not also get applied to the main request
        // when using Symfony Proxy, as tag handler does not clear tags between requests.
        $response->headers->set($this->tagHeader, $this->repoPrefix . 'ez-user-context-hash');
    }
public function tagUserContext(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        if (!$response->isCacheable()) {
            return;
        }

        if ($response->headers->get('Content-Type') !== 'application/vnd.fos.user-context-hash') {
            return;
        }

        if (!$response->getTtl()) {
            return;
        }

        // We need to set tag directly on repsonse here to make sure this does not also get applied to the main request
        // when using Symfony Proxy, as tag handler does not clear tags between requests.
        $response->headers->set($this->tagHeader, $this->repoPrefix . 'ez-user-context-hash');
    }
public function tagUserContext ( FilterResponseEvent $ event ) { $ response = $ event -> getResponse ( ) ; if ( ! $ response -> isCacheable ( ) ) { return ; } if ( $ response -> headers -> get ( 'Content-Type' ) !== 'application/vnd.fos.user-context-hash' ) { return ; } if ( ! $ response -> getTtl ( ) ) { return ; } // We need to set tag directly on repsonse here to make sure this does not also get applied to the main request // when using Symfony Proxy, as tag handler does not clear tags between requests. $ response -> headers -> set ( $ this -> tagHeader , $ this -> repoPrefix . 'ez-user-context-hash' ) ; }
Tag vnd.fos.user-context-hash responses if they are set to cached.

@param FilterResponseEvent $event
Tag vnd . fos . user - context - hash responses if they are set to cached .