Original release time: 2021-04-03 19:03:04

The original post address: blog. Dsrkafuu. Su/post / 2021 / h…

Today, I heard that CloudFlare’s new web hosting service CloudFlare Pages is officially in open beta, and I immediately tried it out. After GitHub Pages, Netlify, and Vercel (Zeit), there is finally a free service with unlimited bandwidth.

Service details

CloudFlare Pages offers free users an unlimited number of sites, requests, and bandwidth, in addition to paying users getting more builds and sites built at the same time:

After opening the test, the Pages service can be found in the CloudFlare Administration panel navigation bar:

Add site

After clicking “Create Project”, you need to configure the CloudFlare Pages Application on your GitHub account.

After the configuration is complete, you can select projects and add sites:

CloudFlare Pages, like other services, supports most traditional static sites and SPA single-page applications, but so far there are relatively few configuration items and so on.

After adding, you can see the build process; In terms of personal experience, CloudFlare Pages is currently being built relatively slowly compared to Vercel, which I currently use for most of my personal projects:

Configuration of the domain name

After the site is built, it can be accessed through the pages. Dev subdomain provided by CloudFlare. At the same time, switch to the “Custom Domain” panel and add unlimited custom domain names:

At present, Pages cannot customize the jump of multiple domain names like Vercel, so it needs to be implemented by domain name DNS provider. It is important to note that if your domain name is hosted by CloudFlare DNS, then CF proxies can be enabled normally.

Advanced Settings

Currently, Pages provides relatively few advanced Settings. Only branches, environment variables and the most basic build Settings can be set, including installation Settings, SPA fallback and other Settings cannot be customized.

The Pages document currently lists the known problems as of now (2021-04-03). Here is a translation of its content:

  • Deleting a project with a custom domain name may result in the last build still being accessible on that domain name, requiring a complete removal of DNS records to resolve the issue
  • There is currently no custom route jump available, which is first attempted when accessing a page that does not exist404.htmlFile. If the file does not exist, it will fallback toindex.htmlTo support SPA routing
  • Preview urls do not support Access
  • Currently, only GitHub can be deployed, and multiple projects in Monorepo cannot be deployed at one time
  • There is no way to change the association between the GitHub repo and Pages projects and the rebuild needs to be removed to resolve the issue
  • Currently assignedpages.devThe domain name cannot be changed and needs to be deleted and rebuilt to resolve the problem
  • The Hugo project build will default to the old version, which needs to be set manuallyHUGO_VERSIONEnvironment variables are customized
  • The build uses Node.js 10 by default and requires theNODE_VERSIONEnvironment variable or.nvmrcThe file is customized