r/CloudFlare • u/pritam_06 • Oct 31 '26
What is the basic difference between Cloudflare pages & Cloudflare workers?
I'm 19. I am building a project. But I would not figure out where do I host that project on pages or workers?
If anybody knows which one is better for what, please feel free to share that.
48
Upvotes
•
u/AutoModerator Oct 31 '26
For faster advice with technical questions, we'd recommend asking in the Orange Cloud Discord server; the unofficial Cloudflare Discord server by the community, for the community. https://discord.gg/TrPNVKaagR
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
39
u/ryanscio Oct 31 '26
short answer: just use Workers, CF Pages is now largely just maintained.
31
u/bunoso Oct 31 '26
Workers can do most everything that pages can do, and are the recommendation for all new projects, I think. I think of Pages like a CDN. They serve static content. Workers are actual computer that run javascript functions to preform work. They can also have static asset serving (CDN) and can connect to other services like databases and KV stores.
6
u/mixBayes Oct 31 '26
Workers basically covers everything Pages does now. Pages is mainly for static sites and frontend hosting, while Workers can do a lot more.
2
u/fcmyk Oct 31 '26
Cloudflare officially recommends building on workers over pages.
2
u/Dapper-Maybe-5347 Oct 31 '26
This isn't up for debate. Any new site built in Cloudflare should use Workers.
2
u/pdfops Oct 31 '26 •
Pages is for sites with a build step (static or frontend framework), git push triggers a build and deploy, plus you can drop server code in a /functions folder for simple API routes. Workers is raw serverless compute, no build pipeline required, full control over routing, bindings (KV, D1, R2), and cron triggers. Gotcha: Pages Functions actually run on the Workers runtime under the hood, so if your project is more backend/API than frontend, skip Pages and just write a Worker directly, you get more config control via wrangler.toml.
1
u/TimelyLivingCore Oct 31 '26
i have found my favorite use for workers is to Detect when any of my services and websites go down it automatically routes to a maintenance page instead of just providing something like a 502 error or anything similar especially if i am busy touching grass
1
u/Far_Smell6757 Nov 02 '26
The way it was before was:
Now they're both merged into workers (pages was replaced with Workers Static Assets)
Pages still technically exists but it's basically redundant and Cloudflare is pushing users to migrate to workers, and iirc eventually they're going to forcefully migrate all pages
1
u/FirstGoogleReview Nov 03 '26
Pages is going to be merged with workers, so you don't need to worry about pages much
1
u/West_Construction285 Oct 31 '26 •
For a typical project, I’d start with Cloudflare Pages for the frontend. It’s easy to deploy from Git and static files are served from Cloudflare’s CDN. Use a Worker when you need backend logic for things like APIs or authentication. You can also add Pages Functions to a Pages project.
Dynamic requests need to run your code and may wait for a database or API call, which can add latency. Pages Functions use the Workers runtime too, so the main difference is whether a request can be served as a static file or needs backend processing.