public static function waitingPage()

in app/classes/ReleaseInsights/Request.php [122:147]


    public static function waitingPage(string $action): void
    {
        if ($action == 'load') {
            // This is a long-running process when we fetch and generate data
            set_time_limit(0);
            // We need to set the encoding or the browser will wait to parse the content
            header('Content-type: text/html; charset=utf-8');
            // Explicitly disable caching so Varnish and other upstreams won't cache.
            header("Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0");
            // Emulate the header BigPipe sends so we can test through Varnish.
            header('Surrogate-Control: BigPipe/1.0');
            // Disable gzip compression to allow sending a chunk of html
            header('Content-Encoding: none');
            // Setting this header instructs Nginx to disable fastcgi_buffering and disable gzip for this request.
            header('X-Accel-Buffering: no');
            // Display a waiting page while we process data. This file contains the flushing logic.
            include VIEWS . 'waiting_page.html.php';
        } elseif ($action == 'leave') {
            // heavy processing is done, let the browser refresh the page
            echo '<meta http-equiv="refresh" content="0">';
            exit;
        } elseif ($action == 'hide') {
            // heavy processing is done, let the browser refresh the page
            echo '<style nonce="' . NONCE . '">.waitingpage .container { display:none; }</style>';
        }
    }