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

    pinko64

    12/02/2021, 10:01 AM
    127.0.0.1:8788/em works. 127.0.0.1:8788/api/em does NOT work. Is this a wrangler bug(windows using wrangler pages dev myfolder)? Or am i missing something?
  • s

    Shyamin

    12/02/2021, 10:14 AM
    I don;t know about Windows environment but in Linux this same kind of route configuration works fine with new wrangler@beta 🙂
  • s

    Shyamin

    12/02/2021, 10:15 AM
    I had the same kind of directory structure and it worked fine on local development environment but there was some errors on external API calls once I deploy it in to CF
  • p

    pinko64

    12/02/2021, 10:29 AM
    Ok. Maybe i'll try it with liunx when i get home. 😩
  • s

    Shyamin

    12/02/2021, 10:31 AM
    yeah, I suggest you to create a issue in Github repo mentioning this behaviors in Windows
  • s

    Shyamin

    12/02/2021, 10:31 AM
    it'll help to debug and fix this 🙂
  • p

    pinko64

    12/02/2021, 10:44 AM
    Seems to be already listed (https://github.com/cloudflare/wrangler2/issues/51) And the temporary fix seems to work.
  • w

    wonkrattle

    12/02/2021, 11:13 AM
    @User do you guys still have it in your queue to take a look at why my website is using so many functions requests for only a handful of page views?
  • w

    wonkrattle

    12/02/2021, 11:14 AM
    We’re talking about 2000 requests for perhaps five page views
  • e

    Erwin

    12/02/2021, 11:50 AM
    Do you happen to load 400 assets on the page? Joking aside, right now every request to the domain goes through the function and thus gets counted.. I think the pages team is hoping to at some point restrict it so that the functions are only triggered on routes that actually have functions defined for them.
  • w

    wonkrattle

    12/02/2021, 11:51 AM
    No I understand that, but even at that point it wouldn’t make sense
  • w

    wonkrattle

    12/02/2021, 11:52 AM
    Like there just cannot possibly have been 2400 requests to the domain
  • w

    wonkrattle

    12/02/2021, 11:53 AM
    Like the pages are mostly text, with like two or three CSS files
  • w

    wonkrattle

    12/02/2021, 11:55 AM
    Like I’m not trying to complain @User , I don’t get enough traffic right now to for it to be a problem, but it just does not make any sense to me
  • e

    Erwin

    12/02/2021, 12:08 PM
    Have you turned on analytics to see what the requests are?
  • w

    wonkrattle

    12/02/2021, 12:14 PM
    I don’t have pro
  • w

    wonkrattle

    12/02/2021, 12:15 PM
    Otherwise i would
  • e

    Erwin

    12/02/2021, 12:19 PM
    Create a middleware function that logs the request in KV or something?
  • w

    wonkrattle

    12/02/2021, 12:20 PM
    That seems like a pretty reasonable amount of work. I’m only reporting it because I think something might be up on your end, and I wanted to be helpful
  • w

    wonkrattle

    12/02/2021, 12:20 PM
    If it doesn’t rise to the level of taking a look, I understand
  • e

    Erwin

    12/02/2021, 12:49 PM
    Oh it is absolutely appreciated! with a million things that we could/should/want to be doing it is always hard to prioritise. So this particular report by itself doesn't rise to the level of taking a look, if this is just you, and you aren't actually hitting your limit. But it does help a lot if we have another report or two to help us pinpoint where the issue could be. Right now the most likely explanation is that this is just random bots crawling your domain.. But if we have another customer who is having a similar issue it becomes more and more likely it is really a problem on our side.
  • e

    Erwin

    12/02/2021, 12:50 PM
    I hope that makes sense? Even though it isn't something we will act on immediately, we great appreciate you reaching out 🙂
  • s

    Shyamin

    12/02/2021, 1:21 PM
    do we have ETA on this new implementation ?
  • s

    Shyamin

    12/02/2021, 1:47 PM
    is external API calls using fetch API somehow banned in Cloudflare Pages functions ?
  • w

    Walshy | Pages

    12/02/2021, 1:48 PM
    nope
  • j

    Jeremiahlee

    12/02/2021, 1:50 PM
    I am using
    fetch
    to call the SendGrid API successfully.
  • w

    wonkrattle

    12/02/2021, 3:52 PM
    Except, I can see how many requests are due to my activity because I can see the count go up in real time. I first noticed this when I was rebuilding my site and testing it repeatedly over the course of a couple hours. It’s not bots. A single page hit results in hundreds of requests.
  • w

    wonkrattle

    12/02/2021, 3:54 PM
    Oh shit, I just realized what it is. It’s the service worker
  • w

    wonkrattle

    12/02/2021, 3:55 PM
    When someone hits the homepage it downloads the entire site in the background
  • w

    wonkrattle

    12/02/2021, 4:02 PM
    Is there any way to exempt requests from functions using like headers
1...262728...392Latest