public function onResponse(FilterResponseEvent $event)
    {
        if (!$event->isMasterRequest()) {
            return;
        }

        $request = $event->getRequest();
        if (Zone::isAsync($request) || $request->isXmlHttpRequest()) {
            return;
        }

        $response = $event->getResponse();
        if ($response->isRedirection() || $response->isEmpty() || $response->isInformational()) {
            return;
        }
        if (strpos($response->headers->get('Content-Type'), 'text/html') === false) {
            return;
        }

        $this->addSnippets();

        foreach ($this->queues as $queue) {
            $queue->process($request, $response);
        }
    }