Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join

TBH by far the easiest way to migrate

TBH, by far the easiest way to migrate from Drive to R2 is to get a cheap, high-bandwidth VPS for a day, transfer everything with RClone, and then shut it back down. While you might be saving yourself a dollar or two, the amount of work required to do it would probably cost you more

Could you use a worker to be a websocket

Could you use a worker to be a websocket client? Like say I make a request to wake up a worker, then that worker then connects to a websocket server and waits for messages, then when new messages come in it processes them (or a durable object doesn't really matter)

Question: Are there any plans to support

Question: Are there any plans to support code splitting in workers? i.e: ```typescript ...

Can you create two asyncs in one

Can you create two asyncs in one cloudflare worker? Im trying to apply custom CSS & apply a cookie under a condition but the required responses are different. Not sure how to merge these together

```

Your worker called response.clone(), but did not read the body of both clones. This is wasteful, as it forces the system to buffer the entire response body in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the response headers and metadata (e.g. in order to be able to modify them), use `new Response(response.body, response)` instead.
Your worker called response.clone(), but did not read the body of both clones. This is wasteful, as it forces the system to buffer the entire response body in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the response headers and metadata (e.g. in order to be able to modify them), use `new Response(response.body, response)` instead.
^ I don't understand this, as I don't even have a .clone() in my script....

For log storage what makes the most

For log storage, what makes the most sense to use as a backed? R2, D1, or KV? Or something else?

Right now I have built a website that

Right now I have built a website that hides pricing unless a cookie is present. I am using cloudflare workers to restore pricing information through styling when the cookie is present. However, this worker is breaking the "Add to Cart" functionality on my side

You could have a custom esbuild setup

You could have a custom esbuild setup for Workers that strips ?module when building?

This was autogenerated by workers Using

This was autogenerated by workers (Using Custom Domains and routes off) and its been sitting like that for 4 days now. If I go to custom domains on the worker, it says Initializing.

Gzip

Any bright ideas for the best approach for handling gzipped data that's served as binary blobs with no headers? Would a proxy worker which adds a gzip header (e.g. a service-worker) work and give me uncompressed text?

What exactly are they hoping to do CF

What exactly are they hoping to do? CF-Worker is per-Worker but if they’re just looking to whitelist Workers in general then it’ll be IP ranges or ASN.

If you add `AS13335` to your whitelist

If you add AS13335 to your whitelist, it should allow all Cloudflare IPs through your firewall automatically.

It would need to be done on L7 as the

It would need to be done on L7 as the only way to identify a Worker uniquely is the CF-Worker request header

CF Worker Stripe - Error No signatures found matching the expected signature for payload.

It's wayyy easier in Wrangler 2! I have a blog post for verifying Stripe Webhook Signatures at https://jross.me/verifying-stripe-webhook-signatures-cloudflare-workers/. You can ignore the parts after "Setup" if you just want to get Stripe working with wrangler2 😄

Real data in local mode

Hey everyone! We've recently been thinking about using real production KV/R2 data in local mode with wrangler dev --local and Miniflare. This suggestion was raised a while ago by @Erwin (https://github.com/cloudflare/miniflare/issues/24), but it would be great to get feedback from you all on this idea. How do you think this should work? Would you prefer if we always fetched/wrote from/to your actual KV namespaces/R2 buckets to give you the most up-to-date values? Or would you prefer the lower-latency of fetching values once then caching them locally? Would you be ok if we just fetched all of your data in one go, and then you just developed as if it were local, or have you got too many keys/objects for that?...

503 issue

it's a proxied worker

Property 'default' does not exist on type 'CacheStorage'

I am seeing a typescript error for let response = await caches.default.match(req); which shows Property 'default' does not exist on type 'CacheStorage'. ts(2339) It seems to be using the CacheStorage definition from /node_modules/typescript/lib/lib.dom.d.ts instead of @cloudflare/workers-types...