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

    Erwin

    01/01/2022, 9:09 AM
    That is indeed a discrepancy between Miniflare and Workers. That would be a good issue to flag. Can you create an issue on the GitHub?
  • e

    Erwin

    01/01/2022, 9:12 AM
    @dfcowell 👆
  • s

    steranevdy

    01/01/2022, 9:17 AM
    is paid workers plan also available for pages functions?
  • d

    dfcowell

    01/01/2022, 10:24 AM
    Can do. On a plane right now, but once I’m back home and at my computer I’ll hop to it. 👍🏼 Thanks for confirming!
  • e

    Erwin

    01/01/2022, 12:52 PM
    Not yet, will be when they go GA. But you can request to have your limit raised if you want
  • s

    steranevdy

    01/01/2022, 12:52 PM
    possible to request cpu time increase to 50ms?
  • w

    Walshy | Pages

    01/01/2022, 1:19 PM
    If you have Workers paid then you get that AFAIK
  • s

    steranevdy

    01/01/2022, 1:26 PM
    @User but it looks like at the moment pages functions is running on free tier only
  • w

    Walshy | Pages

    01/01/2022, 1:26 PM
    I believe it should follow your Workers plan since it does basically make a Worker on your account
  • w

    Walshy | Pages

    01/01/2022, 1:26 PM
    I may be wrong so worth verifying
  • e

    Erwin

    01/01/2022, 2:24 PM
    I am fairly certain @Walshy | Pages is correct and it follows the plan on your account. So if you upgrade to the $5 bundled plan, that should also upgrade your Pages Functions.
  • s

    steranevdy

    01/01/2022, 2:27 PM
    nice. thanks!
  • s

    sandeepsihari

    01/02/2022, 7:14 AM
    hey I am using this command to run functions locally. It was working fine on my Mac but today i cloned the repo on windows 11 machine and when i tried to call the api it throws
    404
    on
    /api/auth/send-otp
    (file structure
    functions/api/auth/send-otp.js
    ) but working fine for the root level api i.e
    /api
    Copy code
    npx wrangler pages dev --binding JWT_SECRET_KEY="this is super secret key" TEXTLOCAL_SENDER_ID="ADHOMS" --kv OTP --proxy 3000 -- npx next dev
    did anyone else faced similar issue?
  • s

    sandeepsihari

    01/02/2022, 7:22 AM
    it only picking up the
    /api/index.js
    route. everything else is throwing
    404
  • a

    amithm7

    01/02/2022, 3:05 PM
    Is there any to debug live / preview deployment? If the worker throws an exception, cloudflare says to look at logs of worker. But where is it?
    wrangler2
    (@beta) using
    miniflare
    behaves quite differently to actual pages function. For example: https://github.com/cloudflare/wrangler2/issues/165#issuecomment-1003532637
  • w

    William | Chaos Management

    01/02/2022, 4:51 PM
    hey there, in my pages function, i have some data i want to cache, however, KV costs money when used over 1GB, is there any free way to cache this data?
  • j

    James

    01/02/2022, 4:53 PM
    You could use the
    cache.put
    etc. APIs and construct dummy responses to store it if you wanted, and don't really care about when it's not cached, since that's colo specific. KV is probably your best option though if you don't want to go external.
  • j

    James

    01/02/2022, 4:54 PM
    Oh actually I've no idea if the cache APIs work in functions - they should I imagine? Otherwise something like https://upstash.com/ could be worth looking at if you want to go external. That'll probably end up being more expensive than KV I imagine though
  • w

    Walshy | Pages

    01/02/2022, 4:55 PM
    They should work yeah
  • w

    William | Chaos Management

    01/02/2022, 4:56 PM
    does the cache API allow me to cache by query string?
  • w

    Walshy | Pages

    01/02/2022, 4:56 PM
    you define the cache key so yes if you wanted to
  • j

    James

    01/02/2022, 4:56 PM
    cache.match
    works with
    Request
    objects, so yeah you could create one that's defined with a query string, etc.
  • w

    Walshy | Pages

    01/02/2022, 4:56 PM
    KV is wonderful though
  • w

    William | Chaos Management

    01/02/2022, 4:57 PM
    oh cool, ill try it out
  • j

    James

    01/02/2022, 4:57 PM
    +1 for KV though yeah. What are you caching that'll exceed 1GB out of interest?
  • w

    William | Chaos Management

    01/02/2022, 4:57 PM
    I'm not sure that it would exceed 1GB of space, but I want to cache dns lookups that my app uses
  • j

    James

    01/02/2022, 4:58 PM
    Caching DNS lookups? Is there much of a performance hit when you're not doing that? I'd be shocked
  • w

    William | Chaos Management

    01/02/2022, 4:59 PM
    I'm honestly not sure if there is much of a performance hit at the moment
  • w

    Walshy | Pages

    01/02/2022, 4:59 PM
    yeah I'd probably use Cache API there with like a 5 min TTL
  • w

    Walshy | Pages

    01/02/2022, 4:59 PM
    ¯\_(ツ)_/¯
1...505152...392Latest