-
-
Notifications
You must be signed in to change notification settings - Fork 1
Hosting
Autumn edited this page Sep 10, 2025
·
2 revisions
- GitHub Pages deploys its own static server for sites built by its Actions tools.
- You do not have any control over content headers or cache policy.
- GitHub does not provide any guarantees whatsoever about your traffic usage patterns or limits.
- Cloudflare has a free tier that grants you DNS controls and easy migration from elsewhere.
- Cloudflare is useful in particular because you need not buy a domain name from them (or anyone) to run free DNS there.
- Normally you are unable to use the Proxied-type of record without ruining your site.
- To gain the value of Cloudflare's proxied DNS, you should continue to set up caching that allows you to also enable Proxied DNS.
- Using Cloudflare's Cache settings, you can push your GitHub Pages static resources out to "Edge" resources.
- For your GitHub Pages domain in Cloudflare, the sidebar offers Cache and Tiered Cache settings.
- Cache settings should set Edge caching rules that ignore GitHub's cache control (which you cannot modify and isn't protecting you from much).
- TTL is how long the Edge will keep its copy (of anything, everything) without asking GitHub Pages for an update.
- If you use a long TTL for a low-update site, just be aware that changing your CSS/JS/image/html on those cached URLs may give you old resource files on new pages you launch. If this happens, your TTL must expire before the new resource files are respected.
- To avoid cache questions on specific files, suffix a version like
?v1so you can change it (each time, if you need to break TTL) - To avoid cache issues generally but without precision, add
?t={{ site.time }}or something so that it is always unique when you build the site's HTML for a release, and all files are fetched together.
- Tiered Cache is something separate you can just turn on with a radio button, and it will make sure hot access points are ready with the same Edge data without you knowing the traffic regions in advance.