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

推荐订阅源

G
Google Developers Blog
Google DeepMind News
Google DeepMind News
Hugging Face - Blog
Hugging Face - Blog
D
Docker
F
Fortinet All Blogs
博客园 - 三生石上(FineUI控件)
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Simon Willison's Weblog
Simon Willison's Weblog
S
Security Affairs
NISL@THU
NISL@THU
T
Tor Project blog
A
About on SuperTechFans
宝玉的分享
宝玉的分享
腾讯CDC
S
Schneier on Security
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Privacy & Cybersecurity Law Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
P
Privacy International News Feed
雷峰网
雷峰网
C
Cyber Attacks, Cyber Crime and Cyber Security
Vercel News
Vercel News
Cisco Talos Blog
Cisco Talos Blog
D
DataBreaches.Net
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Google Online Security Blog
Google Online Security Blog
Recorded Future
Recorded Future
L
LINUX DO - 热门话题
Microsoft Security Blog
Microsoft Security Blog
Latest news
Latest news
C
Check Point Blog
有赞技术团队
有赞技术团队
T
The Exploit Database - CXSecurity.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
云风的 BLOG
云风的 BLOG
SecWiki News
SecWiki News
Application and Cybersecurity Blog
Application and Cybersecurity Blog
爱范儿
爱范儿
月光博客
月光博客
V
Vulnerabilities – Threatpost
T
Threat Research - Cisco Blogs
P
Palo Alto Networks Blog
T
The Blog of Author Tim Ferriss
C
Cisco Blogs
Webroot Blog
Webroot Blog
S
Security @ Cisco Blogs

Fgaoxing

MiniGFM:3KB的轻量Markdown渲染库 Go反射:性能瓶颈与零拷贝优化 至全体朋友 Goh:一款Go语言的预编译快速模板引擎。(Benchmark排名第一) 【预告】关于函数传参时栈的变化 【谈谈当下】青少年口中的垃圾话语 【LSP】微型滚动动画库 推一下 Vercel 加速节点 网站优化小窍门 【显微镜下的世界】0x1 【CDNN】CDNN再添一员 懒加载的妙用:缓存篇 【FastJump.js】简单的快速跳转技术 BiliBili崩了 【New Bing】New Bing免代理申请和使用 simplest-server Python实现文件查重 放开想,越离谱越好 2022 夏季应用推荐
【Hexo】优化教程
Fgaoxing · 2023-07-17 · via Fgaoxing

本文章将从部署速度和访问速度两方面说说如何优化Hexo博客

¶部署速度

我们可看到Hexo的官网上告诉我们Hexo的生成速度还是很快的

https://npm.elemecdn.com/ytblogimg/5e4545888b77352d759bb8e4c20259bf.png

那为啥需要那么长时间呢,我们看看部署的流程

  1. 从NPM安装包
  2. 运行Hexo生成指令
  3. glup压缩(可选)

这个流程每次都要运行一遍,非常耗时,如何优化呢

¶NPM安装加速

首先确定服务器位置,Github服务器在美国,所以呢只能使用NPM获取优化不了

但是Vercel可以选择节点位置,方法如下:

打开一个项目

https://npm.elemecdn.com/ytblogimg/377239b28a4f1f4151ff826eb696e057.png

点击设置
https://npm.elemecdn.com/ytblogimg/f796110a9f2b0fb8a96c069b11d877ee.png然后按图中的配置
https://npm.elemecdn.com/ytblogimg/f03b06eb870514a1ea597f9b588cd639.png

然后就可以使用NPM镜像了,实测阿里镜像最快

https://npm.elemecdn.com/ytblogimg/b53d09b87284846842341a9806630c77.png

部署的时间可以压缩最少10秒

¶Hexo生成加速

首先就是减少文件数量,能删就删