
The Beauty and the Beast when Deploying Vercel or CloudFlare
It's a story I'm sure happens on a daily basis to a lot of us. I can say I am an expert in front-end web development, and I can do well with deploying or setting up servers. However, the backend and DevOps are not my strongest.
Deploying to Vercel or CloudFlare, which one I ended up using
It's a story I'm about to share. I have done a lot of research, and even with all the time spent to figure out which one is which and which one does what, I still ended up needing to test my applications and the entire process from my code leaving my computer ending up on those cloud solutions.
So I had to compare the pros and cons
And I have to say from many points of view, Cloudflare is the winner, as it offers unmetered or unlimited traffic, while Vercel only offers about 100GB for the free plan.
In my mind, I always thought about implementing ISR, Incremental Server Rendering, so the pages could be cached, and while they expire, a cache rebuild is kicked in the backend. When it's ready, the request will be served using the new cached value.
Well, on Cloudflare, this is a big bummer; it just doesn't work.
I had to create a deployment key, followed by implementing an API. Then in the interface, I created a button that calls the API and triggers a manual deployment. Using Cloudflare, this is the only way to get the new content presented or reflected on the webpage.
However, Cloudflare also is missing a lot of fault values for constants when dealing with applications. This led me to have to add those details on every page, in every layout, and on every route, which kind of made me wonder if this is the proper way to do it.
There were also some extra configurations that only Cloudflare wanted to be there, and the deployment would fail without them. It was working just fine when I built it on my local when I deployed to something like Vercel.
So I gave it a try and I switched only the main domain to Vercel
And guess what? Deployment wasn't straightforward as I dreamed it to be. I could estimate that the number of deployment errors was about half of the ones that I encountered on Cloudflare. I also had to spend some time ignoring some builds, as the free version only offers about 500 of them per month, and you can run out of them pretty quickly.
However, the ISR on Vercel works out of the box without too many issues or none at all. From my testing I could see that also the loading is just as good as the one on Cloudflare; however, Vercel tends to be a little bit faster.
I've also tested and implemented some strategies to play with different branches and control when code is deployed and when code is just pushed to GitHub.
I'll keep sharing my journey to strategies and jobs quicker and increase the search success rate, as well as applying the income streams, and keep you up to date with And, well, all this journey seems to be extra interesting or extra extra.