100k requests - what does it mean?

Hey guys, can you please tell me what this means? 100k requests for what exactly, visitors? I only have one static website... What happens if the 100k is reached, I dont even know how I got the 9k till now
No description
26 Replies
Hard@Work
Hard@Work2mo ago
I curl your Worker: curl https://worker_name.konstandin.workers.dev, that's one request. This is also affected by bots visiting your Worker
Konstandin
KonstandinOP2mo ago
Okay wait what is a worker XD
Hard@Work
Hard@Work2mo ago
Cloudflare Docs
Cloudflare Workers · Cloudflare Workers docs
Cloudflare Workers provides a serverless execution environment that allows you to create new applications or augment existing ones without configuring or maintaining infrastructure.
Konstandin
KonstandinOP2mo ago
Okay, if I understand it correctly it takes up some loading on the server instead of the client? Sorry man, I am a beginner
Hard@Work
Hard@Work2mo ago
Yeah, basically it just runs some code in Cloudflare's datacenters It's a bit more complex than this, but that's a small gist
Konstandin
KonstandinOP2mo ago
But the site will work normally if it hits 100k yes? Just the client has more work to do no?
Hard@Work
Hard@Work2mo ago
It depends on how the app is built. Some will handle it gracefully, but others may break entirely
Konstandin
KonstandinOP2mo ago
As I said, I just have a simple portfolio, no fancy stuff, some framer motion, but that all is "use client" Does building a page on CF take up these credits too?
Hard@Work
Hard@Work2mo ago
Assuming that it is fully static, you shouldn't be consuming any requests. Do you have a repo for your project?
Konstandin
KonstandinOP2mo ago
I'm sorry, I can't share it. My guess is that probably building the websites after I commit take up the requests, is this possible? Or DNS stuff? Google Fonts import urls, image urls or NextJS image optimization wouldn't use up workers/functions, correct?
Hard@Work
Hard@Work2mo ago
Oh, if it is NextJS then yes, it burns through requests pretty fast, unless you do a full static build Building doesn't consume any requests It's just request made by the browser
Konstandin
KonstandinOP2mo ago
So what can I do then? I cant switch NextJS xd
Hard@Work
Hard@Work2mo ago
If you can use a static build, I would probably do that
Konstandin
KonstandinOP2mo ago
okay, need to learn what that is
Hard@Work
Hard@Work2mo ago
Otherwise, you can use Workers Paid, which removes the limit
Konstandin
KonstandinOP2mo ago
Yeah I saw that I will try to have a static build first though I did select the Framework preset as NextJS instead NextJS (Static HTML Export), can this be the issue? If yes, if I redeploy the site with the correct preset, do I have to make changes to the code too?
Hard@Work
Hard@Work2mo ago
Changing the preset shouldn't make a difference, your project needs to be configured to build as a static project first
Konstandin
KonstandinOP2mo ago
>.<
Hard@Work
Hard@Work2mo ago
If you use API Routes in your project, you can't go static, for example
Konstandin
KonstandinOP2mo ago
I dont have any APIs whatsoever Can I DM you a link ? Ok nevermind, I think I got it static now. I will see if the rates increase further It seems like they have not increased further (+1 request instead of hundreds) Will watch it tomorrow again, Thank you so much for your help!!! @Hard@Work No workers used anymore. Nice! However I still wonder, what the exact difference now was. What used the workers, while the site was non-static? I would like to implement a automatic language detection based on the accept-header, but I think I would need to have a non-static site for that? Then I would have the same problem again xD
ajgeiss0702
ajgeiss07022mo ago
if you were using Cloudflare Pages, NextJS probably auto-generated a function, which is billed the same as workers.
Konstandin
KonstandinOP2mo ago
Okay, how can we disable these specific functions? I don't quite get it...
ajgeiss0702
ajgeiss07022mo ago
it sounds like you already did, if you specify nextjs to build a static-only site
Konstandin
KonstandinOP2mo ago
Thats correct, however I would like to have the locale auto-detected, this is probably not possible with static pages? or am I wrong?
ajgeiss0702
ajgeiss07022mo ago
you could probably do it client-side, but the main issue with that is that people would see the default language first before js loads (assuming youre doing static ssr)
Konstandin
KonstandinOP2mo ago
Yeah, thats annoying thats why I wondered where these random requests come from, to stop them and use them for something useful like the locales localization Yeah, middleware doesnt work with static pages

Did you find this page helpful?