<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog Tech on Hongjiang Bao's Blog</title><link>http://baohongjiang.com/en/tags/blog-tech/</link><description>Recent content in Blog Tech on Hongjiang Bao's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 13 Dec 2023 00:00:00 +0000</lastBuildDate><atom:link href="http://baohongjiang.com/en/tags/blog-tech/index.xml" rel="self" type="application/rss+xml"/><item><title>The Tech Behind My Blog</title><link>http://baohongjiang.com/en/p/the-tech-behind-my-blog/</link><pubDate>Wed, 13 Dec 2023 00:00:00 +0000</pubDate><guid>http://baohongjiang.com/en/p/the-tech-behind-my-blog/</guid><description>&lt;h3 id="problems-i-needed-the-blog-to-solve"&gt;Problems I needed the blog to solve
&lt;/h3&gt;&lt;p&gt;Before building the blog, I had a few requirements:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Pick a simple, general-purpose blog framework — and one that looks good.&lt;/li&gt;
&lt;li&gt;Full feature set: comments, etc.&lt;/li&gt;
&lt;li&gt;Bullet-proof against attacks, especially DDoS.&lt;/li&gt;
&lt;li&gt;Optimized for mainland-China network conditions — fast access from inside China too.&lt;/li&gt;
&lt;li&gt;No ICP filing — even though there&amp;rsquo;s no problematic content, I just don&amp;rsquo;t want the hassle.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="full-breakdown-of-the-tech"&gt;Full breakdown of the tech
&lt;/h3&gt;&lt;p&gt;The blog framework is Hugo (Go), with a sharp-looking theme.
The site is fully hosted on GitHub Pages; the backend is a GitHub Codespace where I write remotely with VS Code. GitHub Actions auto-deploys on push, so a new post is live in about 10 seconds.
On Cloudflare I bought 10 years of &lt;code&gt;baohongjiang.com&lt;/code&gt; and pointed it at GitHub Pages. Visit &lt;code&gt;baohongjiang.com&lt;/code&gt; and you&amp;rsquo;re at the blog. Everything is HTTPS-encrypted end to end.
Traffic analytics use Google Analytics and Cloudflare in parallel, so I have accurate visitor metrics.
Comments are managed via Disqus — for well-known reasons, comments are not visible or postable from inside mainland China.&lt;/p&gt;
&lt;p&gt;At this point the blog is full-featured and fast. The site is essentially static, so backend attacks aren&amp;rsquo;t a thing. And because the site is hosted on GitHub Pages and proxied through Cloudflare, a DDoS attack would have to first break Cloudflare and &lt;em&gt;then&lt;/em&gt; take down GitHub before it could even touch my blog. Roughly speaking, you&amp;rsquo;d need tens of terabits per second to be able to hurt me. I kind of wish my blog were big enough to be worth that kind of attack. Haha.&lt;/p&gt;
&lt;p&gt;Now, for well-known reasons, although mainland China can reach the site fine and the speed is OK, latency is over 200ms and packet loss is bad. So I had to specifically optimize for mainland China.
Cloudflare does have geo load-balancing, but it&amp;rsquo;s enterprise-only and &lt;em&gt;expensive&lt;/em&gt;. So I bought &lt;code&gt;baohongjiang.cn&lt;/code&gt;, ran a bunch of tests, and picked the best Hong Kong GIA-line VPS I could find for nginx reverse-proxying.
When you visit &lt;code&gt;baohongjiang.cn&lt;/code&gt;, you&amp;rsquo;re really hitting the GIA-line VPS, which then fetches my site. Latency from mainland Chinese ISPs drops to around 30ms with very low packet loss. It flies.&lt;/p&gt;
&lt;p&gt;The full request path:
user → baohongjiang.cn → Hong Kong VPS → baohongjiang.com → Cloudflare → GitHub Pages (origin)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;baohongjiang.com&lt;/code&gt; is the rock-solid international entry point. &lt;code&gt;baohongjiang.cn&lt;/code&gt; is the mainland-China fast lane.&lt;/p&gt;
&lt;p&gt;This setup is &lt;em&gt;not&lt;/em&gt; the cheapest possible — straight GitHub Pages costs you nothing. But I just wanted to flex.&lt;/p&gt;</description></item></channel></rss>