1. 更换Gravatar头像源方法:
    修改在根目录的config.inc.php

    //更换头像源
    define('__TYPECHO_GRAVATAR_PREFIX__', 'https://gravatar.loli.net/avatar/'); 

    这里修改为loli.net提供的加速

  2. 修改Typecho的gravatar头像获取方法
    修改/var/Typecho/common.php

        public static function gravatarUrl(?string $mail,int $size,?string $rating = null,?string $default = null,bool $isSecure = true): string {
            $reg = "/^\d{5,11}@[qQ][Qq]\.(com)$/";
            if (preg_match($reg, $mail)) {
                $img    = explode("@", $mail);
                $url = "//q2.qlogo.cn/headimg_dl?dst_uin={$img[0]}&spec=100";
            } else {
                if (defined('__TYPECHO_GRAVATAR_PREFIX__')) {
                    $url = __TYPECHO_GRAVATAR_PREFIX__;
                } else {
                    $url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com';
                    $url .= '/avatar/';
                }
    
                if (!empty($mail)) {
                    $url .= md5(strtolower(trim($mail)));
                }
    
                $url .= '?s=' . $size;
    
                if (isset($rating)) {
                    $url .= '&r=' . $rating;
                }
    
                if (isset($default)) {
                    $url .= '&d=' . $default;
                }
            }
            return $url;
        }