https://discord.cloudflare.com logo
Join Discord
Powered by
# functions
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 9:58 PM
    We’re figuring out if we can get smarter about that when we come out of beta, but yes, even static assets without any matching route will count as an invocation.
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 9:59 PM
    Just get in touch if it’s an issue and we’ll be more than happy to up that 100k limit.
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:00 PM
    For a little behind-the-scenes, what we’re doing at the moment is just compiling the functions directory into an _worker.js.
  • w

    wonkrattle

    11/20/2021, 10:00 PM
    You explained it to me already, but I didn’t fully understand, it looks like the weather.js file that I have produces static HTML when it reaches the browser. is the difference with an HTMLrewriter that that is changing content on an already existing static page versus generating one from whole cloth?
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:00 PM
    And that gets invoked for all incoming requests.
  • g

    gerred

    11/20/2021, 10:01 PM
    @User I sent a support req, we're about 99% sure of migrating almost all of our backend over to CF + CF pages and moving a bunch more into durable objects, we're super thrilled but getting hit hard by that req limit at the moment. looking at doing some more clever things with setting up another service, but need service bindings too. no worries today, but I'm working on machinery.
  • g

    gerred

    11/20/2021, 10:01 PM
    AH!
  • w

    William | Chaos Management

    11/20/2021, 10:01 PM
    I'd think that only requests to matching routes would count as an invocation, would this behavior change when pages functions leaves beta?
  • g

    gerred

    11/20/2021, 10:01 PM
    so there's no functional difference between _worker.js and all of the functions
  • i

    itsmatteomanf

    11/20/2021, 10:01 PM
    Yeah, you can see the file when building locally 🙂
  • i

    itsmatteomanf

    11/20/2021, 10:01 PM
    DX wise yeah, but functionality apparently not.
  • g

    gerred

    11/20/2021, 10:01 PM
    that's good to know, I was trying to automatically strip out our SSR into individual functions.
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:02 PM
    cloth?
  • i

    itsmatteomanf

    11/20/2021, 10:02 PM
    https://discord.com/channels/595317990191398933/910978223968518144/911737392371732540
  • w

    wonkrattle

    11/20/2021, 10:02 PM
    I will say, for predominantly static websites like a Jekyll blog, that would definitely make a big difference in invocations.
  • w

    wonkrattle

    11/20/2021, 10:02 PM
    Generating it from scratch,
  • w

    William | Chaos Management

    11/20/2021, 10:02 PM
    ah didnt see that message
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:03 PM
    This Google form is the best place for requests to raise that limit: https://docs.google.com/forms/d/e/1FAIpQLSe4N0BjIxu9AuissCAtYjXUovViXmdx2zopjzASaJi_SImJsw/viewform?usp=send_form Appreciate you trying out Pages and functions!
  • w

    wonkrattle

    11/20/2021, 10:03 PM
    https://grammarist.com/idiom/out-of-whole-cloth/
  • g

    gerred

    11/20/2021, 10:03 PM
    @User perfect, one form I hadn't filled out yet. 😂
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:04 PM
    We might change it, so don't rely on this behavior, but yeah, they're pretty functionally similar at the moment.
    functions
    gives you simple routing behavior and an arguably easier API, but they boil down to the same thing at the moment.
  • g

    gerred

    11/20/2021, 10:05 PM
    @User Does the separated Routes -> workers feature do the same thing functionally as well?
  • g

    gerred

    11/20/2021, 10:05 PM
    i.e. is there an optimization path to be had today on my end?
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:07 PM
    Absolutely. But bear in mind folks, that this is no worse than what Workers Sites does today. We'll absolutely be trying to figure out when we can know the request isn't anything functions-y, but we just don't have the answers right now.
  • w

    William | Chaos Management

    11/20/2021, 10:08 PM
    makes sense
  • i

    itsmatteomanf

    11/20/2021, 10:08 PM
    You mean deploying a separate Worker?
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:10 PM
    Normal Workers will only be invoked if the incoming request matches the route you set.
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:10 PM
    But seriously, if you're trying to use functions and are concerned about that limit, we'll just raise it for you!
  • g

    Greg Brimble | Cloudflare Pages

    11/20/2021, 10:11 PM
    Definitely don't want that being a concern for you trying out functions and giving us vital feedback 🙂
  • g

    gerred

    11/20/2021, 10:11 PM
    er, to be a little more specific (thank you for answering on your weekend!) - with regular workers Routes, do all of those, from a "total size of isolate" perspective get compiled down the same way? and even with the goal to shrink cold starts, is there a benefit today to, with multiple routes, splitting out those workers?
1...678...392Latest