惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

W-Blog - 分享兴趣,记录生活 - Typecho

为什么依然选择 Typecho?已经不是一个技术话题,而是一个关于“创作主权”的立场问题
告别加载焦虑:Typecho 接入 Cravatar 头像加速方案
Patmon · 2026-03-04 · via W-Blog - 分享兴趣,记录生活 - Typecho

由   Patmon  撰写于    浏览:110  评论:0  Tags: Typecho, Cravatar 头像

5754353.jpg

为什么需要优化 Gravatar? 头像加载缓慢或“裂图”是很多站长的心病。受限于网络环境,原生 Gravatar 服务在不同时段常出现访问受阻,这不仅拖慢了页面响应速度,更直接影响访客的视觉体验,导致跳出率上升。

本站推荐:Cravatar 镜像服务 Cravatar 是国内目前首选的头像解决方案,具备以下核心优势:

  • 极致速度:基于国内多节点 CDN 分发,瞬间加载。

  • 多源合一:自动匹配 Gravatar、QQ 头像及自建头像库,大幅提升头像点亮率。

  • 品牌统一:让您的访客在不同平台拥有一致的数字身份。


🛠️ Typecho 配置指南(二选一)

方案一:修改内核(即您提供的方法)

此方法直接生效,但建议在系统更新前做好备份。

打开 /var/Typecho/Common.php,找到约第 811 行左右的代码:

PHP

$url = $isSecure ? 'https://secure.gravatar.com' : 'http://www.gravatar.com';$url .= '/avatar/';

修改为:

PHP

// 统一使用 Cravatar 国内镜像源$url = 'https://cravatar.cn/avatar/';

方案二:无损配置(推荐 ✨)

无需改动内核代码,升级 Typecho 也不受影响。

直接在网站根目录的 config.inc.php 文件最后加入以下一行代码即可:

PHP

define('__TYPECHO_GRAVATAR_PREFIX__', 'https://cravatar.cn/avatar/');

💡 补充说明

  1. 关于 HTTPS:Cravatar 全线支持 HTTPS,建议直接硬编码为 https 以确保安全性。

  2. 即时生效:修改后如未见变化,请尝试清理浏览器缓存或 CDN 缓存。