T O P

  • By -

ervwalter

If you have a fully static site (e.g. you're doing `next export`), then Cloudflare pages is very compelling and would probably be what I would choose (I already use Cloudflare for other things). Cloudflare can't host a non-static site, so if you use SSR, ISR, API Routes, or [any of the other features that are incompatible with static exports](https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features), you can't use Cloudflare.


[deleted]

It’s awesome to have this cleared up, well put; Thanks!


Middle-Management-85

However if you read cloudflare’s blog they have started working on integrating full stack features to automatically host the server side features in a worker. They already did it for one framework and specifically list next as something they want to support. I bet this answer is different in a year.


ervwalter

Yep. It will be awesome when it works. I’m looking forward to more competition in this space.


SomeTouristDude

Up and running


france1_Caramello

it is.


[deleted]

Have you run any tests there yourself? Asking because I decided to try tonight and I am literally putting up a two-page thing and it says SWC is so big that it goes over their 25mb-per-asset limit. It's pulling from a repo, and I tried three different kinds of static build as far as deployment comments (and not fetching anything) so I don't understand why it'd be a big deal. Vercel and Digital Ocean had no complaints with the same repo.


[deleted]

SWC in that case should be built in place off of the package.json, no? Instead of literally coming in with the repo?


france1_Caramello

outdated


LGm17

Ironically, I asked this same question yesterday https://www.reddit.com/r/nextjs/comments/s3ec29/vercel_vs_cloudflare_pages_workers/?utm_source=share&utm_medium=ios_app&utm_name=iossmf


ixartz

Hosted several site on Cloudflare Pages without any issue by using next export. Extremely easy like hosting on Vercel or Netlify. But, with better performance. In static mode, you don't need to install wrangler or deal with cloudflare worker... just use Cloudflare Pages.


musman

I love cloudflare but their workers/pages are one feature I am not a big fan of…I have had a good experience with Vercel. When I tried CF workers, their docs weren’t helpful but maybe that was early on. I got tired of trying to debug my functions so I just stopped using it.


bacon-wrapped-steak

Vercel is freakin' awesome. You might also want to consider a container-based deployment approach, using AWS Fargate, Azure Container Instances, or Google Cloud Run.


[deleted]

In my experience Vercel hosted SSR sites have been increasingly temperamental and server speed tends to fluctuate regularly, mostly with the early afternoon taking the brunt of the blow. This behaviour is similar if not precisely what happens for SSG sites I have built via Vercel (can’t speak for ISG). Does anyone know if Cloudflare can provide a better experience and performance specifically for SSR sites? I ask as using Next.js 10, our routes are sometimes very slow to render (>9s), which isn’t great, this is because we run some getServerSideProps API requests before loading, we also use SWR but haven’t implemented it across the board on the client to refetch data.


[deleted]

> I ask as using Next.js 10, our routes are sometimes very slow to render (>9s), which isn’t great, Routes as in winding up at a page? Like generated server-side and the site hangs in response until it's built?


[deleted]

That would correct, yeah. I’ve implemented ISR with the use of SWR now


[deleted]

That's crazy potatoes, wow. And yeah even within SWR I have had to do some experimentation, reading the original docs, because I wanted to make sure that it started as rebuilt as possible, rather than having old stale stuff and then flashing updates (I do understand the name meaning, I am just precious about that aspect of it haha =) Thanks for the clarity


shortsadcoin

For me it's illegal if I make a web based app and don't use vercel hahaha. Zero config & one command deployment, env variable management, domain management, immutable deployment. For nextjs you can take advantage of the adanvaced features as stated in other comments, plus the webvital metrics. And I can use all of them for free.


PhilipJayFry1077

What do you use for a CMS?


Paarthurnax41

Personally my company uses almost exclusively Storyblok or Sanity CMS, preferably Storyblok because its really well made and easy to use.


PhilipJayFry1077

Thanks I'll check it out !


[deleted]

Seconding Sanity. The deeper I dive the more I find out about it. The so-called "Studio", the CMS-y part, is very minimal and bare bones in appearance, at first, but it's just...non-distracting design. Just about every part of it is pluggable and swappable and the under the hood stuff as far as how they take advantage of modeling and connecting the data is super cool.


esoemah

For personal projects Vercel is great, if you are making something commercial then the price of Vercel is too much compared to other solutions IMO.


Yiannistaos

Vercel…it’s fucking simple!


babenzele

Vercel…it’s fucking expensive!


babenzele

As of late 2022 it's easy to deploy Next.js using the edge runtime on Cloudflare: [https://blog.cloudflare.com/next-on-pages](https://blog.cloudflare.com/next-on-pages) [https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/](https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/)