Http/Response.php
public function cache($expires)
    {
        if ($expires === false) {
            $this->_headers['Expires'] = 'Mon, 26 Jul 1997 05:00:00 GMT';
            $this->_headers['Cache-Control'] = array(
                'no-store, no-cache, must-revalidate',
                'post-check=0, pre-check=0',
                'max-age=0'
            );
            $this->_headers['Pragma'] = 'no-cache';
        } else {
            $expires = is_string($expires) ? strtotime($expires) : $expires;
            $this->_headers['Expires'] = gmdate('D, d M Y H:i:s', $expires).' GMT';
            $this->_headers['Cache-Control'] = 'max-age='.($expires - time());
        }
        return $this;
    }
public function cache($expires)
    {
        if ($expires === false) {
            $this->_headers['Expires'] = 'Mon, 26 Jul 1997 05:00:00 GMT';
            $this->_headers['Cache-Control'] = array(
                'no-store, no-cache, must-revalidate',
                'post-check=0, pre-check=0',
                'max-age=0'
            );
            $this->_headers['Pragma'] = 'no-cache';
        } else {
            $expires = is_string($expires) ? strtotime($expires) : $expires;
            $this->_headers['Expires'] = gmdate('D, d M Y H:i:s', $expires).' GMT';
            $this->_headers['Cache-Control'] = 'max-age='.($expires - time());
        }
        return $this;
    }
public function cache ( $ expires ) { if ( $ expires === false ) { $ this -> _headers [ 'Expires' ] = 'Mon, 26 Jul 1997 05:00:00 GMT' ; $ this -> _headers [ 'Cache-Control' ] = array ( 'no-store, no-cache, must-revalidate' , 'post-check=0, pre-check=0' , 'max-age=0' ) ; $ this -> _headers [ 'Pragma' ] = 'no-cache' ; } else { $ expires = is_string ( $ expires ) ? strtotime ( $ expires ) : $ expires ; $ this -> _headers [ 'Expires' ] = gmdate ( 'D, d M Y H:i:s' , $ expires ) . ' GMT' ; $ this -> _headers [ 'Cache-Control' ] = 'max-age=' . ( $ expires - time ( ) ) ; } return $ this ; }
Sets the caching headers for the response.

@param string|int|false $expires
@return \m\Http\Response
Sets the caching headers for the response .