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

I m running into issues trying to

I'm running into issues trying to consume a enscripten-built WASM npm package from a JS worker. are there any examples out there? i see a couple articles from 2018, but they don't seem accurate or focused enough

Probably been discussed a lot but any

Probably been discussed a lot, but any chance worker subrequests can reach other ports than 80/443? The use case is connecting to an external ClickHouse or ElasticSearch database, typically hosted on port 8123 or 9200, without having to have an intermediary router. Tx
They can't unfortunately
Sorry, for digging something up from a couple months ago, but I just stumbled upon this and it seems to blow up my plans for using CF Workers... ...

Stripe

I saw that and it's incredibly exciting. I haven't tested it yet though

Durable objects would be ok for

Durable objects would be ok for matchmaking at a small scale but at larger scale durable objects will quickly start to have some issues that will be pretty complex to try and solve. I would personally recommend using a service dedicated to matchmaking and hosting on an actual server 🤷

Merging Two Workers Together

Need some help merging two worker scripts together. One is a redirect and another alters CSS. Both are working when unmerged. Can someone please help me?

šŸ› BUG: Doing fetch requests in a Worker...

Hi, I have updated my workers and they are using 2.8.1 and now, when I do a env.SERVICE.fetch(request.clone()) it stalls with a " TypeError: Cannot construct a Request with a Request object that has already been used." And it was working before, both in local and deployed in CF....

How come Cloudflare Cache API doesn t

How come Cloudflare Cache API doesn't implement some methods such as keys() etc? Probably a reason why but it doesn't mention it

oh dang so turns out even the beta of

oh dang, so turns out even the beta of email Workers can't access the message body. To get cheap high ish volume inbound email processing, what's your recommendations? AWS SES as well for inbound? https://developers.cloudflare.com/email-routing/email-workers/...

cache API alternatives

One drawback of using KV for the cache is that there is no easy way to purge that cache. With the current approach by using Cache API we put a custom Cache-Tag to a response, let's say category name. And then once we update pages in that category we call CF API to purge cache by that cache tag. There might be a million pages in that category, so we just purge by cache tag and no need to purge cache for each page. Maybe I didn't completely get the idea of the approach used in worker sites (https://blog.cloudflare.com/extending-the-workers-platform/) but looks like it doesn't fit our use case as we can't update millions of pages in KV. I thought maybe we can have different KV namespaces per each category, so when we need to purge the cache - recreate the namespace. There is a limit of 100 namespaces and we might have thousands of categories. ...

With my cloudflare worker I fail with

With my cloudflare worker I fail with the error [mf:err] Cause: RequestContentLengthMismatchError: Request body length does not match content-length header from the following API response: ``` Note: Unnecessary use of -X or --request, POST is already inferred.
content-length: 697 content-type: application/x-www-form-urlencoded...

what s the correct way to consume wasm

what's the correct way to consume wasm for workers? i've been trying the example at https://blog.cloudflare.com/announcing-wasi-on-workers/ with wrangler but it's not happy with import demoWasm from "./demo.wasm"; kind of import (ts complains about a missing loader)

Incremental adoption of micro-frontends ...

I just came across this recent Cloudflare blog post talking about Fragment Piercing. It seems like quite a useful approach for improving a legacy application, but one thing isn't quite clear to me - how do you implement the Piercing Gateway Worker? Specifically, how does the browser know to point to the Piercing Gateway Worker rather than the Legacy Application host/server? Is there a way to point a domain's DNS to a specific CF Worker? Until I found this post, my plan was to just use Workers in conjunction with a client-side Service Worker to intercept requests and manipulate them as necessary. https://blog.cloudflare.com/fragment-piercing/...

cloudflare workers consuming too many api requests for one webpage

Everytime i get make a request to my full stack app in cloudflare pages , 40-60 cloudflare requests are happening & which is consuming my daily limit of workers quickly. Is there any way to minimize the number of requests worker send when i request a web page or can i cache somehow so my users can't request same webpage multiple times to workers & so i can save my workers requests for other users ? Please suggest what are u doing to override these problems

I m trying to run a js worker that calls

I'm trying to run a js worker that calls a rust library (using wasm_bindgen). I haven't found any examples that do this. I've only seen rust-only workers using worker-build. I get Trace: wasm.__wbindgen_add_to_stack_pointer is not a function. Could anyone know what I should try?

I m using D1 and trying to apply a

I'm using D1 and trying to apply a schema.sql file onto it. However, a few statements don't get read (Parsing 3 statements -> Executed 1 command in 9.842563999816775ms), with no error messages. I've narrowed it down to the INSERT INTO command. The first one works, but the next ones don't. šŸ˜… I don't know what to do

Does anyone here know any decent

Does anyone here know any decent distributed databases for CF Workers? I am using MongoDB with their HTTP Data API right now but my requests are ending up almost 5-10 seconds in some regions. Would be great if any recommendations have full text search....

Integration with Cloudflare Workers – Gr...

hello all. has anyone tested out how the graphql yoga subscriptions work with cloudflare workers? presumably the subscription only lasts as long as the worker http request remains active (server sent events not ws) ..... https://the-guild.dev/graphql/yoga-server/docs/integrations/integration-with-cloudflare-workers

Logs & Websockets

logs will show up once the ws connection has been terminated, from my experience