Cloudflare Pages was initially announced back in mid-December 2020. Since I’m already using its CDN on mdleom.com, it’s a no-brainer to me to adopt it. At first glance, this may result in better performance than my previous setup which puts Cloudflare CDN in front of Netlify. So, I went straight for the beta sign up.
The sign up email said that I will be notified when it’s ready for testing. Today I noticed it’s available on my dashboard, despite never receive the notification.
The installation was straightforward, I just need to install Cloudflare Pages app on my GitHub account. Currently, it only supports GitHub, fortunately I have a GitHub mirror of my primary blog repo on GitLab.
Once the app is installed, I granted access to the blog repo. After that, it redirected back to the Cloudflare to continue setup. The next step is to specify the repo again. Then, I specified a unique project name, this has to be unique among all Cloudflare Pages; in this case, I use “curben” so it’s hosted at curben.pages.dev. I selected “Hexo” from the framework preset selections, this resulted in
hexo generate build command and
public output directory. Alternatively, you could also specify
npm run build command if you install Hexo after 4 Oct 2019; this convention is similar to Svelte and Vue.
Every push to the git repo will trigger a new build and subsequently a new snapshot; in my case, curben.pages.dev always points to the latest snapshot. Having a snapshot means I can easily revert to previous one without having to revert git commits, though it’s not available yet. This feature is not new, it was one of the earliest features of Netlify that differentiate itself from other static site hosting.
Speaking of Netlify, I haven’t replace it with Clouflare Pages and currently not planning to. Instead, I deploy my blog (including .onion and Eepsite) with a active/standby load balancer that points to the following backend:
- curben.pages.dev (active)
- curben.netlify.app (standby)
- curben.gitlab.io (standby)