<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>site | 木叶吟</title><link>https://yezhisheng.me/zh/tag/site/</link><atom:link href="https://yezhisheng.me/zh/tag/site/index.xml" rel="self" type="application/rss+xml"/><description>site</description><generator>Wowchemy (https://wowchemy.com)</generator><language>zh-Hans</language><copyright> 又拍云提供CDN服务
京ICP备16021535号-1</copyright><lastBuildDate>Mon, 30 Aug 2021 12:10:58 +0800</lastBuildDate><image><url>https://yezhisheng.me/media/icon_hu585778a5d9441f07b7d64e1beae1be58_320895_512x512_fill_lanczos_center_3.png</url><title>site</title><link>https://yezhisheng.me/zh/tag/site/</link></image><item><title>本站优化与服务</title><link>https://yezhisheng.me/zh/post/optimizations-and-services/</link><pubDate>Mon, 30 Aug 2021 12:10:58 +0800</pubDate><guid>https://yezhisheng.me/zh/post/optimizations-and-services/</guid><description>&lt;h2 id="本站做过的优化">本站做过的优化&lt;/h2>
&lt;h3 id="构建流程">构建流程&lt;/h3>
&lt;p>整个站点由 Hugo 生成，本质上是一组静态页面。作为一个 Golang 用户，我很难完全客观地评价 Hugo 用 Go modules 管理主题这件事是否优雅，尤其是它还要求构建环境里有合适的 Hugo binary 和 Go 环境。不过至少从结果看，构建速度确实非常快。&lt;/p>
&lt;p>和很多 Hugo 站点类似，&lt;code>yezhisheng.me&lt;/code> 的构建流程由 GitHub Actions 在仓库 push 后触发，生成的静态内容再通过 CDN 分发给最终访问者。&lt;/p>
&lt;h3 id="cdn">CDN&lt;/h3>
&lt;ul>
&lt;li>&lt;a href="https://pages.cloudflare.com/" target="_blank" rel="noopener">Cloudflare Pages&lt;/a> 用于全球访问。&lt;/li>
&lt;li>&lt;a href="https://www.upyun.com" target="_blank" rel="noopener">Upyun&lt;/a> 用于服务 &lt;a href="https://yezhisheng.com.cn" target="_blank" rel="noopener">https://yezhisheng.com.cn&lt;/a>。&lt;/li>
&lt;/ul>
&lt;p>在比较过 &lt;a href="https://vercel.com/dashboard" target="_blank" rel="noopener">Vercel&lt;/a> 和 &lt;a href="https://www.cloudflare.com" target="_blank" rel="noopener">Cloudflare&lt;/a> 之后，我最终选择了 Cloudflare。主要原因是它对 IPv6 的支持比较完整，在中国大陆 CERNET 环境里的响应速度也更好。不过 Vercel 在构建流水线方面更灵活，对中国大陆其他 ISP 的质量也可能更稳定，同时还提供基于 LetsEncrypt 的自动 SSL 证书续期，对配置 CAA 记录也很方便。&lt;/p>
&lt;p>Cloudflare 对我来说比较熟悉，毕竟已经持续用了五年多。它的 CNAME 加速也很容易通过简单点击启用。另一个值得一提的点是，Cloudflare Pages 可以直接镜像 GitHub Pages 原始仓库里的 HTML 文件，这样回源开销基本可以摊薄到亚毫秒级别。&lt;/p>
&lt;p>中国大陆的情况稍微不同。无论是 OSS 还是带 HTTPS 的 CDN，主流云厂商几乎都很难长期免费提供，包括阿里云、腾讯云、七牛云，更不用说 AWS China 和 Azure China。最后我选择了又拍云，主要是因为它提供免费的 HTTPS CDN 和 HTTP/3 支持，代价是节点数量较少，也没有 HTTPS rewrite。源站则直接设置为 GitHub Pages。&lt;/p>
&lt;h3 id="主题相关优化">主题相关优化&lt;/h3>
&lt;ul>
&lt;li>&lt;a href="https://wowchemy.com/docs/guide/offline-site/" target="_blank" rel="noopener">静态资源本地化&lt;/a>&lt;/li>
&lt;li>&lt;a href="http://instantclick.io/" target="_blank" rel="noopener">InstantClick&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="当前服务">当前服务&lt;/h2>
&lt;p>得益于 Cloudflare 的开发体验和易用性，一些小服务逐渐以几乎零额外成本的方式跑了起来，背后主要依赖 Cloudflare CDN 和 Cloudflare Workers。&lt;/p>
&lt;h3 id="反向代理">反向代理&lt;/h3>
&lt;ul>
&lt;li>&lt;a href="https://ao3.yezhisheng.me/" target="_blank" rel="noopener">AO3&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://g.yezhisheng.me/" target="_blank" rel="noopener">Google search&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://proxy.yezhisheng.me/-----https://www.baidu.com/" target="_blank" rel="noopener">Proxy&lt;/a>&lt;/li>
&lt;/ul>
&lt;h3 id="其他">其他&lt;/h3>
&lt;ul>
&lt;li>&lt;a href="https://pkg.yezhisheng.me/" target="_blank" rel="noopener">Personal Go module&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://system-ddls.yezhisheng.me/" target="_blank" rel="noopener">System conference deadlines&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>