public function cached($public = true, $expires = '+1 year')
    {
        if (!is_int($expires)) {
            $expires = strtotime($expires);
        }
        $maxAge = $expires - time();
        $pragma = $public ? 'public' : 'private';
        $cache = $pragma . ', max-age=' . $maxAge;
        $response = clone $this;
        $response->setHeader('Expires', Message::date($expires));
        $response->setHeader('Pragma', $pragma);
        $response->setHeader('Cache-Control', $cache);
        return $response;
    }
public function cached($public = true, $expires = '+1 year')
    {
        if (!is_int($expires)) {
            $expires = strtotime($expires);
        }
        $maxAge = $expires - time();
        $pragma = $public ? 'public' : 'private';
        $cache = $pragma . ', max-age=' . $maxAge;
        $response = clone $this;
        $response->setHeader('Expires', Message::date($expires));
        $response->setHeader('Pragma', $pragma);
        $response->setHeader('Cache-Control', $cache);
        return $response;
    }
public function cached ( $ public = true , $ expires = '+1 year' ) { if ( ! is_int ( $ expires ) ) { $ expires = strtotime ( $ expires ) ; } $ maxAge = $ expires - time ( ) ; $ pragma = $ public ? 'public' : 'private' ; $ cache = $ pragma . ', max-age=' . $ maxAge ; $ response = clone $ this ; $ response -> setHeader ( 'Expires' , Message :: date ( $ expires ) ) ; $ response -> setHeader ( 'Pragma' , $ pragma ) ; $ response -> setHeader ( 'Cache-Control' , $ cache ) ; return $ response ; }
Set cache settings.
@param string $public Public or private.
@param int|string $expires Time on which cache expires. Can be a UNIX
timestamp or a string used with {@see strtotime()}.
Set cache settings .