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

        /**
         * the "W/" prefix is necessary to qualify it as a "weak" Etag.
         * only then a proxy like nginx will leave the tag alone because a strong cannot
         * match if gzip is applied.
         */
        $response->headers->set('ETag', 'W/'.sha1($response->getContent()));
    }
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();

        /**
         * the "W/" prefix is necessary to qualify it as a "weak" Etag.
         * only then a proxy like nginx will leave the tag alone because a strong cannot
         * match if gzip is applied.
         */
        $response->headers->set('ETag', 'W/'.sha1($response->getContent()));
    }
public function onKernelResponse ( FilterResponseEvent $ event ) { $ response = $ event -> getResponse ( ) ; /**
         * the "W/" prefix is necessary to qualify it as a "weak" Etag.
         * only then a proxy like nginx will leave the tag alone because a strong cannot
         * match if gzip is applied.
         */ $ response -> headers -> set ( 'ETag' , 'W/' . sha1 ( $ response -> getContent ( ) ) ) ; }
add a ETag header to the response

@param FilterResponseEvent $event response listener event

@return void
add a ETag header to the response