protected function cache($length)
    {
        $this->after(function ($response) use ($length) {
            if ($length == 0) {
                $response->cacheControl = 'no-cache';
            } else {
                $response->cacheControl = 'max-age='.$length.', must-revalidate';
            }
        });
    }
protected function cache($length)
    {
        $this->after(function ($response) use ($length) {
            if ($length == 0) {
                $response->cacheControl = 'no-cache';
            } else {
                $response->cacheControl = 'max-age='.$length.', must-revalidate';
            }
        });
    }
protected function cache ( $ length ) { $ this -> after ( function ( $ response ) use ( $ length ) { if ( $ length == 0 ) { $ response -> cacheControl = 'no-cache' ; } else { $ response -> cacheControl = 'max-age=' . $ length . ', must-revalidate' ; } } ) ; }
Set cache control header on response
@param int length Number of seconds to cache the response for
Set cache control header on response