Hexo NextT Enhance Performance

Hexo NextT Enhance Performance

這篇介紹How to enhance Hexo NextT Performance。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Google Chrome Labs推出quicklink,用以實現prefetch。
https://github.com/GoogleChromeLabs/quicklink/

功能:先預載可能要用的資源,達到在使用時是順暢的體驗。

安裝lib:
$ npm install --save quicklink

修改 /themes/next/_config.yml
quicklink:
enable: true

# Home page and archive page can be controlled through home and archive options below.
# This configuration item is independent of `enable`.
home: true
archive: true

vendors:
quicklink: //cdn.jsdelivr.net/npm/[email protected]/dist/quicklink.umd.js

memo: quicklink版本要設定為最新版,F12查看console才不會有錯誤訊息。

hexo-neat

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
功能:靜態資源壓縮

安裝lib:
$ npm install hexo-neat --save

修改 /root/_config.yml
neat_enable: true
neat_html:
enable: true
exclude:
neat_css:
enable: true
exclude:
- '**/*.min.css'
neat_js:
enable: true
mangle: true
output:
compress:
exclude:
- '**/*.min.js'
- '**/jquery.fancybox.pack.js'
- '**/index.js'
- '**/fireworks.js'

memo:在最下方加入即可