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

推荐订阅源

S
Secure Thoughts
S
Securelist
P
Proofpoint News Feed
D
DataBreaches.Net
Cisco Talos Blog
Cisco Talos Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Project Zero
Project Zero
A
About on SuperTechFans
罗磊的独立博客
WordPress大学
WordPress大学
月光博客
月光博客
Latest news
Latest news
C
Cyber Attacks, Cyber Crime and Cyber Security
GbyAI
GbyAI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
P
Privacy International News Feed
AI
AI
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Stack Overflow Blog
Stack Overflow Blog
M
MIT News - Artificial intelligence
Help Net Security
Help Net Security
T
Tor Project blog
V
Vulnerabilities – Threatpost
C
Cisco Blogs
I
Intezer
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MyScale Blog
MyScale Blog
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Forbes - Security
Forbes - Security
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
T
Threat Research - Cisco Blogs
B
Blog RSS Feed
博客园 - 叶小钗
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Simon Willison's Weblog
Simon Willison's Weblog
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
N
News and Events Feed by Topic

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生成加速

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