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

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...

Cache API questions

yeah sorry should have been clearer

Here s a quick snippet for you that

Here's a quick snippet for you that should work: ```ts export default { async fetch(request: Request) { if (new URL(request).pathname === '/app') {...

Generally speaking if you re looking at

Generally speaking if you're looking at firebase and all that I don't think it matters much if you just use postgres like a nosql database aha. I doubt the scale you'd be looking at would be enough to suitable strain postgres before something like firebase would be unrealistically expensive aha. However, you can self host supabase with something like yugabyte db which can support fat rows....

can you screenshot your cloudflare

can you screenshot your cloudflare dashboard nav showing d1 then I can add you to the channel 🙂

In workers I can access D1 when I deploy

In workers. I can access D1 when I deploy using a separate worker, but not in the Remix loader. Also I cannot access D1 when local testing with miniflare.

Hydration problem

So are you partially Server-Side Rendering a Client-Side Framework? That sounds like you are over complicating things…