https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • m

    Matt

    03/29/2023, 3:08 PM
    Can workers responses be cached?
  • z

    zegevlier

    03/29/2023, 3:10 PM
    You can cache what a worker responds using the cache API, but cache doesn't run in front of workers so you need to manually check it and it will cost a workers invocation.
  • m

    Matt

    03/29/2023, 3:12 PM
    Thanks. I've been looking around to see if there are any platforms that allow just the cache hit before the serverless function.
  • z

    zegevlier

    03/29/2023, 3:22 PM
    Is your other serverless function expensive to hit? Workers are cheap compared to some other serverless providers, so it might still make sense to put them in front.
  • u

    0xcaff

    03/29/2023, 5:39 PM
    Is there a way to make a HTTP request from a worker where the body is gzip encoded? Seems like this needs to be done in userland with an imported gzip implementation. Does workers expose a gzip compress API?
    • 1
    • 2
  • s

    sirhype

    03/29/2023, 8:52 PM
    I'm planning for it to be a SPA hosted on Cloudflare Pages and call the API which is hosted on a Worker
  • o

    OIRNOIR

    03/29/2023, 10:00 PM
    i am highly disappointed that https://hello.world.workers.dev/ isn't a thing.
  • o

    OIRNOIR

    03/29/2023, 10:00 PM
    That's my only issue with cf workers.
  • o

    OIRNOIR

    03/29/2023, 10:00 PM
    If hello.world.workers.dev was a thing, i'd say 10/10
  • w

    Walshy | Pages

    03/29/2023, 10:21 PM
    Noted
  • j

    Jeff12345

    03/29/2023, 10:37 PM
    I was using log stream to view worker requests and I'm seeing the REDACTED in a lot of the URLs...is that something Cloudflare is automatically doing to hide the full URL?
  • c

    Cyb3r-Jok3

    03/29/2023, 10:39 PM
    Yeah Cloudflare hides what it consider high entropy from logs
  • c

    Cyb3r-Jok3

    03/29/2023, 10:39 PM
    The code for how it screens is in the workerd repo if you know C++ https://github.com/cloudflare/workerd/blob/1b5057f2bfcfedf146f6f79ff04e99903d55412b/src/workerd/api/util.c%2B%2B#L220 Examples https://github.com/cloudflare/workerd/blob/1b5057f2bfcfedf146f6f79ff04e99903d55412b/src/workerd/api/util-test.c%2B%2B#L24-L60
  • p

    Psychoprolapse

    03/30/2023, 12:57 AM
    Hey guys, before deciding to open or not a thread on #1052656806058528849 , I'd like to ask about the issue here. So my problem looks like this (image attached). I'm not sure what causes the request to be Canceled. I'm using a combination of vk-api and openai-api (chat-gpt). I have no errors in my logs, it just stops producing logs for some reason. You can find my project here if you're interested in details: https://github.com/st4s1k/stas-gpt
  • c

    computeronix

    03/30/2023, 3:51 AM
    awww thank you that helps. interesting!!! ty
  • c

    computeronix

    03/30/2023, 3:53 AM
    qq too in
    Copy code
    wrangler dev
    any quick workaround to ignore this error
    Copy code
    ✘ [ERROR] In development, you should use a separate kv namespace than the one you'd use in production. Please create a new kv namespace with "wrangler kv:namespace create <name> --preview" and add its id as preview_id to the kv_namespace "KV" in your wrangler.toml
  • c

    computeronix

    03/30/2023, 3:53 AM
    i dont want to have a dev KV space lol just let me run with prod data (lol prob having everyone ) -> just let me work in prod 😄
  • k

    kian

    03/30/2023, 3:55 AM
    just add preview_id with the same id
  • c

    computeronix

    03/30/2023, 3:57 AM
    lol 😄 easy enough thx lol need more coffee
  • y

    Yacine Hmito

    03/30/2023, 7:57 AM
    This section of the docs has everything you need: https://developers.cloudflare.com/cloudflare-one/identity/authorization-cookie/ You can take the JWT from the cookie and verify the signature in your Worker.
  • k

    kian

    03/30/2023, 7:58 AM
    https://github.com/cloudflare/pages-plugins/tree/main/packages/cloudflare-access is a good reference for the code that'll do that for you using Workers-compatible packages
  • k

    kian

    03/30/2023, 7:58 AM
    I think Wildebeest has a modified version that fixes some bugs
  • k

    kian

    03/30/2023, 7:58 AM
    It does indeed -
  • s

    sirhype

    03/30/2023, 8:12 AM
    Thank you 🙂 I kept staring at this page then second guessing myself
  • c

    charl

    03/30/2023, 10:51 AM
    Any issues with workers atm, getting a workers.api.error.script_not_found 10007 when trying to deploy a worker. The worker does exist
  • s

    Skye

    03/30/2023, 10:52 AM
    I recall that being a log that occurs when you're on an oldish wrangler version
  • s

    Skye

    03/30/2023, 10:52 AM
    But the worker still publishes fine, it's just for a message it prints afterwards
  • c

    charl

    03/30/2023, 10:55 AM
    just updated wrnagler to 2.13.0 and same
  • c

    charl

    03/30/2023, 10:55 AM
    also logged out and login
  • c

    charl

    03/30/2023, 10:59 AM
    strange, so our other workers deploy fine, its our one that is being used as a saas fallback and trigger being star/star for the zone
1...236923702371...2509Latest