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

    dave

    03/08/2023, 9:26 PM
    https://developers.cloudflare.com/r2/data-access/s3-api/presigned-urls/#presigned-url-alternative-with-workers:~:text=%22If%2DUnmodified%2DSince%22%3A%20%22Tue%2C%2028%20Sep%202021%2016%3A00%3A00%20GMT%22%2C How does the
    If-Unmodified-Since
    header actually enforce anything? Can't clients just write a file multiple times with the same header?
  • k

    kian

    03/08/2023, 9:33 PM
    https://developers.cloudflare.com/r2/data-access/s3-api/extensions/#conditional-operations-in-putobject
  • k

    kian

    03/08/2023, 9:33 PM
    PutObject would reject it with a 304
  • d

    dave

    03/08/2023, 9:56 PM
    huh interesting
  • t

    Tom Sherman

    03/08/2023, 11:14 PM
    Is it possible to trace a worker? I'm mostly interested in finding out how long sub-requests take
  • t

    Tom Sherman

    03/08/2023, 11:14 PM
    I'm assuming the answer is no as I can't find any info on the subject 😅
  • u

    Unsmart | Tech debt

    03/08/2023, 11:15 PM
    you can trace it yourself yes nothing cloudflare provides out of the box automatically at the moment
  • k

    kian

    03/08/2023, 11:15 PM
    you'd just be date.nowing yourself
  • k

    kian

    03/08/2023, 11:16 PM
    all timers in Workers have Spectre mitigations so it won't be exact, but enough to show trends I guess
  • t

    Tom Sherman

    03/08/2023, 11:22 PM
    Should be accurate enough to show sub-request flame graph right?
  • t

    Tom Sherman

    03/08/2023, 11:23 PM
    I guess I'd have to add some logging around subrequests (somehow), and then use a worker to transform the logs into datadog traces
  • h

    HardAtWork

    03/08/2023, 11:36 PM
    Can you DevTool it?
  • t

    Tom Sherman

    03/08/2023, 11:37 PM
    Hmmmm, I haven't used the devtools much. Do they show subrequests in the network tab? Would be super cool
  • t

    Tom Sherman

    03/08/2023, 11:37 PM
    Would help with local debugging for sure, still need production observability tho
  • h

    HardAtWork

    03/08/2023, 11:38 PM
    No idea. I always used Firefox, which seemed to be a little buggy when I tested it
  • h

    HardAtWork

    03/08/2023, 11:38 PM
    You tried a logger like Toucan?
  • t

    Tom Sherman

    03/08/2023, 11:39 PM
    We don't use sentry
  • h

    HardAtWork

    03/08/2023, 11:39 PM
    Or Honeycomb
  • t

    Tom Sherman

    03/08/2023, 11:40 PM
    It's all datadog here 😅
  • u

    Unsmart | Tech debt

    03/08/2023, 11:40 PM
    or AE
  • t

    Tom Sherman

    03/08/2023, 11:40 PM
    I guess I could look at how toucan works, if they are doing tracing
  • j

    James

    03/08/2023, 11:43 PM
    Walshy has a pretty cool Workers tracing library if you wanted to take a look at that, too: https://github.com/BlobDevelopment/workers-tracing
  • t

    Tom Sherman

    03/08/2023, 11:47 PM
    Ok yep this is exactly the kind of thing I was after, thanks folks!
  • t

    Tom Sherman

    03/08/2023, 11:48 PM
    I really think workers are gonna need a tracing story for measuring CPU time at some point tho with more people shipping full apps to workers. No idea how they can pull it off tho 😅
  • d

    Deleted User

    03/09/2023, 1:18 AM
    If a worker returns a fetched item, how long is that item cached?
  • k

    kian

    03/09/2023, 1:19 AM
    By default? 0
  • k

    kian

    03/09/2023, 1:19 AM
    Workers run before the cache so you'd need to place it into the Cache API and retrieve it upon request
  • k

    kian

    03/09/2023, 1:19 AM
    Workers are always invoked, you can't use the cache to prevent it
  • d

    Deleted User

    03/09/2023, 1:19 AM
    That's what I figured
  • d

    Deleted User

    03/09/2023, 1:19 AM
    But it's not fetching an updated page
1...232923302331...2509Latest