Pages Functions limit consumed for no reason?
Hey, I'm unsure if it's the right place but anyways, I've recently received an email from Cloudflare saying that I've surpassed the daily Cloudflare Worker and/or Pages Functions limit. I have no worker setup, nor any functions set up with my pages. I've received a DDoS attack around the time I reached the limit, is there any way that WAF or something else could make this limit rise?
14 Replies
Might be worth reiterating again: Nothing but your own Workers or Pages consume those requests
I would check these though:
What do you see on the Workers & Pages page in the top right about your usage? Same thing, being over 100k?
If you sort by Requests, you could see any Workers consuming requests.
For pages, there's no option to sort, have to click on each and go to Function Metrics sadly. Like I mentioned before, a lot of frameworks like next on pages automatically make functions for you
I had to pay for the 5$ plan so I could deploy again one of my pages
But yeah, it was showing 5M/100k requests
Seems like it comes from the nuxt app functions
but I literally have no functions set up in that app
at least as far as I'm aware (there's no /functions directory in my dist folder)
Nuxt Cloudflare Pages Adapter just creates a _workers.js file, an advanced mode Pages Function, to do SSR and such. If you had your own /functions directory it wouldn't work
Nuxt in build logs should tell you the adapter its using
should be able to force it to use static though/nuxt generate
(they also now have a way to prerender only specific paths, so you can combine static and SSR)
So right now the command is pnpm run build
Maybe I should use generate instead
even though ssr is set to false in nuxt.config.ts
Well that's just executing whatever's in your package.json
I recommend checking the docs here: https://nuxt.com/docs/getting-started/server#hybrid-rendering
(assuming you're using v3)
Nuxt
Server · Get Started with Nuxt
Build full-stack applications with Nuxt's server framework. You can fetch data from your database or another server, create APIs, or even generate static server-side content like a sitemap or a RSS feed - all from a single codebase.
oh yes, I can see in the log that it's building server
I'm unsure
I don't want any ssr
My website should be full static
and yes im using v3
So yes, when using build it was actually adding a _workers folder
That isn't the case with generate
It seems like that was my issue, thank you guys for the help!
You just switched to generate and it worked? Nice. You get unlimited static requests and bandwidth
Yes, it always working with build but among build the statis website, it creates workers stuff
using only generate make sure to not generate worker stuff
this way I'm sure no one can abuse the worker stuff generated in build
Do you know where to find information about the Nuxt Cloudflare Pages Adapter? I would expect that static pages should be pre-rendered in
public
and that the Adapter should do magic to serve server
as functions. 🤔I would look at the cloudflare_pages adapter of nitro: https://nitro.unjs.io/deploy/providers/cloudflare#cloudflare-pages
Thanks, I am well aware of that page. It's just a manual providing steps to follow. It gives no information about what each of those presets does.
I don't think there's documentation about the inner workings, at least there wasn't when I last used nuxt - I'd look at nitro's code, each preset has a couple functions that contain all the custom business logic for that preset