src/Graviton/CacheBundle/Listener/IfNoneMatchResponseListener.php
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        $request = $event->getRequest();

        $ifNoneMatch = $request->headers->get('if-none-match');
        $etag = $response->headers->get('ETag', 'empty');

        if ($ifNoneMatch === $etag) {
            $response->setStatusCode(304);
            $response->setContent(null);
        }
    }
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        $request = $event->getRequest();

        $ifNoneMatch = $request->headers->get('if-none-match');
        $etag = $response->headers->get('ETag', 'empty');

        if ($ifNoneMatch === $etag) {
            $response->setStatusCode(304);
            $response->setContent(null);
        }
    }
public function onKernelResponse ( FilterResponseEvent $ event ) { $ response = $ event -> getResponse ( ) ; $ request = $ event -> getRequest ( ) ; $ ifNoneMatch = $ request -> headers -> get ( 'if-none-match' ) ; $ etag = $ response -> headers -> get ( 'ETag' , 'empty' ) ; if ( $ ifNoneMatch === $ etag ) { $ response -> setStatusCode ( 304 ) ; $ response -> setContent ( null ) ; } }
add a IfNoneMatch header to the response

@param FilterResponseEvent $event response listener event

@return void
add a IfNoneMatch header to the response