I moved from Netlify. The main reasons are DNS and analytics. I already manage all my DNS with Cloudflare, and having everything in the same place is very convenient. Regarding analytics, Cloudflare provides some very basic analytics, which I think are convenient, in Netlify you need to include your own analytics script or use the paid version. I also noticed pages loaded noticeably faster in Cloudflare Pages.
On the other hand, Netlify is specialized in the kind of sites you would host with Cloudflare Pages, so the overall product is more polished towards that. Also, the site build (at least using Hugo) is a lot faster in Netlify. Instant rollbacks in Netlify are wonderful.
Overall, I really like both products a lot and I would not recommend one over the other. It's also important to consider the limits[2-5] of each one. In the free versions, Cloudflare limits by number of builds, Netlify limits the total build minutes. Netlify has a bandwidth limit, Cloudflare does not mention any bandwidth limit.
[0] https://litements.exampl.io/ [1] https://ricardoanderegg.com/ [2] https://www.netlify.com/tos/ [3] https://www.netlify.com/pricing/ [4] https://developers.cloudflare.com/pages/platform/limits [5] https://www.cloudflare.com/plans/
They have their own React frontend framework with next.js but support any static site and dynamic APIs too.
With Netlify and CF as DNS I get the basic 30-day high-level analytics from Cloudflare (# unique visitors is all I look at there), along with some results from google analytics for whoever enables that (which seems to be about 50% of traffic).
So I am not sure what benefit I would get for moving right now, other than to satisfy my curiosity of trying something new and consolidating into one 'hosting' service.
I added my blog to Cloudflare DNS last night, but all I can see for analytics is total requests. No info on pages visited, or how many visitors. All I see is a button to upgrade to pro to get web traffic analytics :(
> Today I also moved my main blog to it.
I wish you hadn't. :(
I am so tired of seeing so many "Cloudflare is trying to verify your browser" while it spends eons trying to fingerprint my browser while also blatantly acting like a brand ad for itself ... it's a really bad user experience.
It's a pity that the web is slowly being taken over by Google AMP pages, Cloudflare pages and Captchas ... especially when they "punish" you for using some anti-browser-fingerprinting methods to protect your privacy.
I eventually moved it back to GitHub Pages. My other sites seems okay tho'.
Googling for the error, I found a few similar questions, but all were responded with: go to discord. So... there's absolutely no way to sort it out by myself or without using discord?
``` 20:54:21.533 Initializing build environment. This may take up to a few minutes to complete 20:54:56.056 Success: Finished initializing build environment 20:54:56.056 Cloning repository... 20:54:59.840 Failed: an internal error occurred ```
I have 2 websites, both gatsby I tried both: 1) gatsby build 2) fully static files (gatsby build on my local computer) and only public dir added to github repo
Websites 10.000 files and 13.000 files (small files 1kB to 300kB) html, css, js, png and webp
Sometimes my build is succefull for this 10.000 files website - like 1 of 5 tries But most build tries fail when deploying: 06:58:47.583 Finished 06:58:48.061 Deploying your site to Cloudflare's global network... 07:18:07.790 Failed due to an internal error
it looks like timeout after 20 minutes.. :(
- Builds randomly fail to deploy and without notification (had to push a random commit to master to trigger a new build)
- If using custom domain, there's no way to redirect myproject.pages.dev to myproject.com so I had to use a <link rel="canonical"> on the off chance Google finds my pages link. I also had to use a page rule to redirect all traffic to www
- I'm not exactly sure how (if it's even possible) to set up a staging environment so that every push to master doesn't automatically deploy to production
- All the cache-control headers are "max-age=0, must-revalidate". I had to create another page rule to edit this to 1 year max age for assets that already have contenthash appended to their file names
- It's hard for me to tell what's causing the issue (the build logs should give an idea of at least at which stage). One thing we've added over the course of the beta is connection to GH comments, which requires a new type of permission. So that might be causing the failure, but also, failed builds should result in a comment (and email) for notifications, depending on your GH settings. All of that said, my email is rita at cloudflare if you want to forward me more details, I can help look into it.
- Creating a canonical notion of your domain is something we're thinking about. Right now the preview links will set X-Robot-Tag so they can't be crawled but yeah, ideally we want to give you a way to remove myproject.pages.dev if you're not using it
- The cache-control settings are intended to keep your site from serving stale content by relying on etags — your browser should still serve from cache if the asset hasn't been updated. On the Cloudflare site, we have much longer TTLs.
Anyway, thanks for trying Pages! We're continuing to iterate on it, even after GA so should only be getting better :)
(edit: spacing :P)
The only thing missing is different build commands per branch and ability to exclude certain branches from builds altogether.
BTW, now that pages.dev is GA, has the 1xxx errors with Workers when Pages are on a different subdomain, fixed? Ref: https://community.cloudflare.com/t/workers-recently-receivin... | Ticket: 2109407
"Jam harder" a nod to jam.dev? (:
Thanks.
Edit: Might want to update https://developers.cloudflare.com/pages/platform/known-issue...
``` { "hosting": { "public": "public", "ignore": ["firebase.json", "*/.", "*/node_modules/*"], "headers": [ { "source": "*/", "headers": [ { "key": "cache-control", "value": "public, max-age=0, must-revalidate" } ] }, ```
It would be great to add "clean urls" - removing trailing slash for directory urls, like in firebase: ``` "hosting": { // ...
// Removes trailing slashes from URLs
"trailingSlash": false
}
```I have also a lot of problems with builds. I tried 2 ways od deploying static pages to Cloudflare:
1) gatsby build 2) fully static page (gatsby build on my local computer and push "public" dir to github repo
both ways are generating error:
08:35:00.770 Finished 08:35:01.232 Deploying your site to Cloudflare's global network... 08:54:16.759 Failed due to an internal error
it looks like a hidden limit - build timeout 20 minutes? My website has 13000 small files (html, js, css, png, webp - max file size is about 300kB) and I cant deploy it because of this error
I even limited image sizes from 1600px to 800px, and limited files to about 10000 files and still I get error
I have another website with 11000 files and I use "gatsby build" - and build is successful for 1 of 5 tries...
Unfortunately, we can't just take the dotnet CLR or deno off the shelf and deploy them the way we've deployed Workers. To make edge computing possible (with good performance and accessible pricing), it's necessary to be able to host tens of thousands of workers on one machine. That means we can't put each worker in its own container. We need something much lighter-weight. So, we built a custom runtime based on V8 isolates. That means we can only run programs built on JavaScript and Wasm, and written against the specific platform API we provide. (It's true that node and deno are also based on V8, but we use V8 in a very different way in order to achieve our scalability and security goals.)
More on how our tech works, and the trade-offs involved: https://www.infoq.com/presentations/cloudflare-v8/
In order to support other languages, we basically have two options:
* Find a way to compile/transpile them to Wasm or JavaScript that works in our runtime. This works better than you'd expect but it definitely has limitations. See: https://blog.cloudflare.com/cloudflare-workers-announces-bro...
* Offer a general container hosting service, as an alternative to Workers. There would have to be some down side here in terms of performance or cost, so we'd still recommend using Workers whenever possible. But we could do this...
I want to my publish my deno project as static page. And I want to publish my Blazor project as static page.
> Cloudflare Pages radically simplifies the process of developing and deploying sites by taking care of all the tedious parts of web development. Now, developers can focus on the fun and creative parts instead.
Reminds me of the Hollywood blockbusters where one can see the meticulous work of the world’s best production, CGI, make-up, animation artists, the best DPs and designers on the planet, get destroyed by superficial stories lacking originality and imagination.
I was really excited to be accepted into the beta, but ultimately didn't want to move stuff to GitHub just for CF Pages.
[1]: https://community.cloudflare.com/t/cloudflare-pages-with-git...
However, I'm a bit concerned when I look at the size, breadth and growth of cloudfare (ie, cloudfare absorbing the web). As a way to lessen these concerns, I would really, really like it if they were to offer cloudfare pages as an IPFS (or gnunet, hypercore, etc) gateway too.
Modify your pages and publish it on IPFS, have the changes propagated on cloudfare: that would be nice :)
... Don't tell me it's already doable? This is awesome!!!
https://developers.cloudflare.com/distributed-web/ipfs-gatew...
1. CNAME for your.website pointing to cloudflare-ipfs.com
2. TXT record for _dnslink.your.website with the value dnslink=/ipfs/<your_hash_here>
And you have a website hosted on both http and ipfs? I'm stoked!Thanks a lot for pointing this out! I did encounter cloudfare's IPFS gateway (on libgen, of all the places) shortly after writing my previous comment, but I hadn't imagined they offered such a pages system with it. I don't know if they cache the pages, though?
Whereas Cloudflare really are allowing people to deploy code at 100's of edge locations
Does cloudflare "really" deploy the code to the edge in any sense (e.g pushed to edge nodes, not just cached there)? I was under the impression this product uses some origin (likely, several) they manage, and their cdn.
Also cloudflare has a good number of POPs but I thought it was in the 100-200 range, not 200+
For example, Durable Objects came out a year ago, was impossible to get into (check community forums and Discord, lots of people eager to just tinker concept who couldn’t).
Now, that super interesting technology that supposed to shake things up a bit, has almost ZERO code samples after a FULL year after announcement. I’m not exaggerating. Check GitHub search.
I write this comment because I could have sworn Pages came out of beta already...
Either way, looking forward to deeper tool integration. The idea of your front end and back end application getting to a point of single commit is attractive.
Edit: Not a FULL year, 6 months or so. See note below
We opened the beta up in March: https://blog.cloudflare.com/durable-objects-open-beta/ If for some reason you are having trouble getting into the beta just drop me an email (jgc).
My point about the roll out of these great products still stands as a bit confusing.
I definitely don’t have the answer and am just communicating my experience.
I agree your team’s Documentation is great.
> Once you’re set up, the only magic words you’ll need are `git commit` and `git push`. We’ll take care of building and deploying your sites for you, so you won’t ever have to leave your current workflow.
> Supporting static sites is just the beginning of the journey for Cloudflare Pages. With redirects support, we’re starting to introduce the first bit of dynamic functionality to Pages, but our ambitions extend far beyond.
> Our long term goal with Pages is to make full-stack application development as breezy an experience as static site development is today. We want to make Pages the deployment target for your static assets, and the APIs that make them dynamic. With Workers and Durable Objects, we believe we have just the toolset to build upon.
> We’ll be starting by allowing you to deploy a Worker function by including it in your /api or /functions directory. Over time, we’ll be introducing new ways for you to deploy Durable Objects or utilize the KV namespaces in the same way.
> Imagine, your entire application — frontend, APIs, storage, data — all deployed with a single commit, easily testable in staging, and a single merge to deploy to production.
What sets it apart from Heroku ?
Heroku takes your backend application code, and runs it dynamically.
Because cf devs may be listening listening, can you please change the css on your blog to this:
@media only screen and (min-width: 960px)
nav {
position: sticky;
top: -0.5px;
background: #FFF;
}Namely, `top: 0;` to `top: -0.5px`. On Retina screens it shows a small gap above the nav.
Also, they probably copied the design from Netlify [1] to improve compatibility and therefore make it easier for people to migrate from Netlify.
[1] https://docs.netlify.com/routing/redirects/#syntax-for-the-r...
It's lower-level, however it's a better option if you have any dynamic/API parts to your site because you can integrate all of that in a single place in your Worker script.
TL;DR: Workers Sites is basically an elaborate Worker template (which you can modify) and allows you to deploy your sites using the Wrangler CLI — it'll take care of uploading your assets and all, but you're responsible for setting up CI, etc for a continuous deployment experience.
Cloudflare Pages, by contract, integrates directly with Github, which allows us to offer a lot more features out of the box, including running your build, preview URLs, etc.
Hope that makes sense.
All the free CF sites I've got were down for those 8 hours via those POPs, and, I had many customers calling to ask why their site was doing and had to explain "sorry, Cloudflare broke just these two POPs..."
It's not perfect, but I'm sure they can fix the quirks soon. My main one was git clone failing and not understanding why("Failed: an internal error occurred"). The other is that I want a way for the pages.dev site alone to be invisible from search engines but couldn't figure out a way to do that with robots.txt. Lastly I wanted to share this feedback during the beta program, but I couldn't find a way other than creating a twitter account and hitting up the PM. Fortunately, this thread saved me from having to do that.
> Lastly I wanted to share this feedback during the beta program, but I couldn't find a way other than creating a twitter account and hitting up the PM.
If you're on Discord, joining our channel is a great way to share feedback: https://discord.gg/HcwPdhDf
> Device-based resizing: To make users’ experiences even smoother, especially on less reliable mobile devices, we want to make sure we’re not sending large images that will only get previewed on a small screen. Our new optimization will appropriately resize the image based on whether the device is mobile or desktop.
wait, what? i feel like this needs more details... can we opt out of it if necessary? (say on a per image, or sitewide, or cookie based, basis) it sounds very nice but the loss of control seems concerning?
I know in the past, I at least would have my entire static site fully cached with Cloudflare using Page Rules.
What do I lose if I moved over to Cloudflare Pages? E.g. slower site performance, etc?
https://support.cloudflare.com/hc/en-us/articles/36002102371...
EDIT:
Follow-up question, what happens if I use Cloudflare Pages and then setup a Page Rule to "cache everything" from Pages?
My guess is that by default it's not fully cached at all of their edge nodes, and by adding an aggressive Page Rule, the edge nodes can actually cache my site (which is very small and simple).
The pricing of Pages is $0/20/$200.
If someone already has an existing Cloudflare account on the: Free ($0) / Pro ($20) / Business ($200) tier - do they get Pages included in their existing plan ... or is Pages an incremental cost?
I have a static site I made for a friend's business and all they need is the ability to switch out a PDF on the site periodically. The approach I've done so far is to have a simple sinatra app that is password protected and gives them an upload form that replaces the pdf on the server. Do any of these hosts offer an asset manager that would let my friend manage images or pdfs via a simplified admin interface and then rebuild the site with the new assets?
So I guess from my perspective, I'd treat this with roughly the same scepticism as a free hosting service provided by Google Analytics, at least until the bigger picture is made a little more clear.
Pages cannot serve files located in a .well-known folder. (https://developers.cloudflare.com/pages/platform/known-issue...)
Otherwise, a fantastic product and a great addition to the ecosystem. The traditional hosting industry (think cpanel etc) hates this btw, so good job!
I have found Cloudflare Pages to be really, really fast. Much faster than Netlify, although they still win based on UI polish & features.
@rita3ko, it'll be nice if we could change the linked GitHub repository without having to delete and recreate a project.
I'm currently trying it on the staging version of a site from my personal GitHub account, but I'll be moving it to an organisation account soon.
Edit: a button or webhook to trigger a build would be great too. I just changed the production branch from my "main" to "develop" branch, but there's no way to rebuild it short of pushing a new commit.
I even build an mac/ios app to track analytics from my AWS Amplify websites https://www.outcoldman.com/en/archive/2021/03/14/cloudanalyt...
I have found about the AWS Amplify after switching to Hugo - https://gohugo.io/hosting-and-deployment/hosting-on-aws-ampl...
https://jace.pro/post/2020-12-17-cloudflare-pages-netlify-ze...
I think Cloudflare has a ways to go before frontend devs really think of them as anything more than just DNS hosting but this looks very promising and a very smart move on their part. Looking forward to trying it!
I have been using CF for a few years now (dns, caching) but the services they've recently launched have been especially impressive (pages, stream).
@rita3ko I would love the ability to disable automatic preview builds. My "production" branch which Cloudflare Pages deploys from has a /public directory which I ship, but my other branches are not structured the same and therefore cause build failures. I just don't need preview builds for my use case.
I tried adding something like blog.domain.tld, and it failed with: "Please ensure you are providing the root domain and not any subdomains (e.g., example.com, not subdomain.example.com)"
Many people would use this service with a subdomain, this is kind of a deal-breaker.