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

推荐订阅源

云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Recent Announcements
Recent Announcements
B
Blog RSS Feed
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
I
InfoQ
L
LangChain Blog
U
Unit 42
Google DeepMind News
Google DeepMind News
I
Intezer
T
Tenable Blog
C
Check Point Blog
N
News and Events Feed by Topic
Project Zero
Project Zero
The Register - Security
The Register - Security
博客园 - Franky
Application and Cybersecurity Blog
Application and Cybersecurity Blog
B
Blog
Forbes - Security
Forbes - Security
Security Archives - TechRepublic
Security Archives - TechRepublic
The Cloudflare Blog
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
N
Netflix TechBlog - Medium
博客园 - 三生石上(FineUI控件)
腾讯CDC
T
Tailwind CSS Blog
SecWiki News
SecWiki News
S
Secure Thoughts
C
Cisco Blogs
M
MIT News - Artificial intelligence
V
Vulnerabilities – Threatpost
小众软件
小众软件
S
Security @ Cisco Blogs
罗磊的独立博客
F
Full Disclosure
aimingoo的专栏
aimingoo的专栏
Google Online Security Blog
Google Online Security Blog
T
Threat Research - Cisco Blogs
博客园 - 聂微东
P
Privacy International News Feed
V
Visual Studio Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Schneier on Security
Schneier on Security
C
Cyber Attacks, Cyber Crime and Cyber Security
Hacker News: Ask HN
Hacker News: Ask HN

Minecraft-Sep

还没有域名建站?2026年最新免费域名推荐 | Minecraft-Sep 还没有域名建站?2026年最新免费域名推荐 | Sep's Blog 搞机日记2——华为儿童手表3X优化 | Minecraft-Sep 搞机日记2——华为儿童手表3X优化 | Sep's Blog Windows实用软件推荐 | Minecraft-Sep Windows实用软件推荐 | Sep's Blog 搞机日记——华为儿童手表3X破解 | Minecraft-Sep 搞机日记——华为儿童手表3X破解 | Sep's Blog 提升效率必备Windows神器PowerToys | Minecraft-Sep 提升效率必备Windows神器PowerToys | Sep's Blog 【Hexo】如何提高静态博客访问速度?Vercel+Cloudflare+CDN让你的网站速度飞起! | Minecraft-Sep Cloudflare Pages+Telegraph搭建简易图床 | Minecraft-Sep Cloudflare Pages+Telegraph搭建简易图床 | Sep's Blog 【Hexo】告别缓慢的 Github Pages,来试试更好的 Vercel 吧! 【Hexo】告别缓慢的 Github Pages,来试试更好的 Vercel 吧! 什么是DDos?它会对博客造成什么威胁?DDos攻击原理与防护方法 | Minecraft-Sep 什么是DDos?它会对博客造成什么威胁?DDos攻击原理与防护方法 | Sep's Blog 202409博客月报 | 第一期 | Minecraft-Sep 202409博客月报 | 第一期 | Sep's Blog 关于博客评论更换的通知 | Minecraft-Sep 关于博客评论更换的通知 | Sep's Blog 免费小型数据库——Vercel Blob初体验 | Minecraft-Sep 免费小型数据库——Vercel Blob初体验 | Sep's Blog 如何让你的博客更丰富?hexo常见插件推荐 | Minecraft-Sep 如何让你的博客更丰富?hexo常见插件推荐 | Sep's Blog 博客一周年记 | Minecraft-Sep 博客一周年记 | Sep's Blog 免费域名怎么弄?常见免费域名指南 | Minecraft-Sep 免费域名怎么弄?常见免费域名指南 | Sep's Blog 利用Cloudflare Workers搭建镜像网站 | Minecraft-Sep 利用Cloudflare Workers搭建镜像网站 | Sep's Blog API构建①——Bing每日一图接口 | Minecraft-Sep API构建①——Bing每日一图接口 | Sep's Blog 【Hexo】Twikoo--评论系统的添加(2) | Minecraft-Sep 【Hexo】Twikoo--评论系统的添加(2) | Sep's Blog 【Hexo】 Waline--评论系统的添加(1) | Minecraft-Sep 【Hexo】 Waline--评论系统的添加(1) | Sep's Blog 【Hexo】Hexo+Github搭建个人博客 | Minecraft-Sep 【Hexo】Hexo+Github搭建个人博客 | Sep's Blog 【HTML】利用localstrange临时存储数据 | Minecraft-Sep 【HTML】利用localstrange临时存储数据 | Sep's Blog
【Hexo】如何提高静态博客访问速度?Vercel+Cloudflare+CDN让你的网站速度飞起! | Sep's Blog
标签 · 2024-11-17 · via Minecraft-Sep

前言

随着博客文章数量的增多,我们的博客可能会变得十分缓慢(比如前段时间的我),今天的教程可以让你的博客提速90%

实操

整改1 扔掉Github Pages

Github Pages真垃圾很慢,看看对比:

名称 Vercel CF Workers(反代) CF Pages Netlify Zeabur Github Pages
速度 🌟🌟🌟🌟🌟 🌟🌟🌟🌟 🌟🌟🌟🌟🌟 🌟🌟🌟🌟🌟 🌟🌟🌟🌟🌟 🌟🌟
稳定性 5 5 5 5 5 5

还不把Github Pages扔了!Vercel他不香吗!参考:

也可以使用 CF Workers反代,参考:利用Cloudflare Workers搭建镜像网站 | Minecraft-Sep (mc-sep.top)

整改2 域名

参考(有几个提别好的):

CDN的全称是Content Delivery Network,即内容分发网络。CDN是构建在现有网络基础之上的智能虚拟网络,依靠部署在各地的边缘服务器,通过中心平台的负载均衡、内容分发、调度等功能模块,使用户就近获取所需内容,降低网络拥塞,提高用户访问响应速度和命中率。CDN的关键技术主要有内容存储和分发技术。

通俗易懂的解释: 通过IP访问实际资源时,如果CDN上并没有缓存资源,则会到源站请求资源,并缓存到CDN节点上,这样,用户下一次访问时,该CDN节点就会有对应资源的缓存了。

Vercel CDN的优化

CF的优化

  • 优化选项卡里的能开就开

注意:最近推出的Speed Brain有问题,不建议使用!

整改4 图片问题

最拖慢速度二巨头:图片过大,图片源不同一(特别是butterfly系列主题深有体会)

建议统一使用一个图床,或者上传到自己的图床,这里提供两个教程

  • CF+Telegraph(维护中)
  • Vercel+Bulb

免费小型数据库——Vercel Blob初体验

其次,图片过大可以使用TinyPNG – 智能压缩您的WebP、JPEG和PNG图片 (tinify.cn)或者TinyPNG – Compress WebP, PNG and JPEG images intelligently压缩,是无损压缩,也可以转换为png,jpeg和webp格式。

或者使用Jsdelivr (jsdelivr.net)加速访问托管在github 的图片:

  1. 将图片上传到github

  2. 在网址栏输入:

    1
    https://cdn.jsdelivr.net/npm/你的github用户名/你保存图片的repo/[图片路径]
  3. 如果出现图片就代表成功!

整改5 Gulp

Gulp是一个hexo插件,用于压缩js和css文件。

  1. 安装:

    1
    npm install gulp compress gulp-clean-css gulp-html-minifier-terser gulp-htmlclean gulp-terser --save-dev
  2. 创建 gulpfile.js 文件:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    var gulp = require('gulp');
    var cleanCSS = require('gulp-clean-css');
    var htmlmin = require('gulp-html-minifier-terser');
    var htmlclean = require('gulp-htmlclean');
    var terser = require('gulp-terser');

    gulp.task('compress', () =>
    gulp.src(['./public/**/*.js', '!./public/**/*.min.js'])
    .pipe(terser())
    .pipe(gulp.dest('./public'))
    )

    gulp.task('minify-css', () => {
    return gulp.src(['./public/**/*.css'])
    .pipe(cleanCSS({
    compatibility: 'ie11'
    }))
    .pipe(gulp.dest('./public'));
    });

    gulp.task('minify-html', () => {
    return gulp.src('./public/**/*.html')
    .pipe(htmlclean())
    .pipe(htmlmin({
    removeComments: true,
    collapseWhitespace: true,
    collapseBooleanAttributes: true,

    removeEmptyAttributes: true,

    removeScriptTypeAttributes: true,

    removeStyleLinkTypeAttributes: true,

    minifyJS: true,
    minifyCSS: true,
    minifyURLs: true
    }))
    .pipe(gulp.dest('./public'))
    });


    gulp.task('default', gulp.parallel(
    'compress', 'minify-css', 'minify-html'
    ))
  3. 运行gulp:

    1
    hexo g&&gulp

加速你也做的差不多了

结束!

版权所有©MC-Sep.

MCSep