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

How to call scheduled tasks in a project built with cloudflare nuxt framework

How to call scheduled tasks in a project built with cloudflare nuxt framework

Unable to access environment variable when using wrangler deploy

So I have an existing project I am trying to deploy to workers. To make it work locally, I moved all environment variable to .dev.vars file and got everything working. Then I put all the environment variables inside cloudflare project I manually created on the dashboard and tried wrangler deploy but it’s not able to access those environment variables.

How CF cache works with cloudflare.

I am trying to figurout how exacly CF cache works with workers. I read that workers are running in front of the cache - so my first assumption was that all request will hit worker even if they are cached but this does not seems to be true First of all, my CF setting is to cache everything, ignore headers for 8 hours. ...
No description

Accessing the request from McpAgent

Hi, I have something like this: ```jsx export class MyMCP extends McpAgent<Env, unknown> { constructor(ctx: DurableObjectState, env: Env) { super(ctx, env);...

Can't preserve variables set by dashboard.

I tried setting keep_vars to true and also false. but everytime the variables from dashboard are replaced with ones in wrangler.toml file. ``` name = "xyz-app" compatibility_date = "2024-07-20"...

Static Assets can't fetch subdirectories

I am facing issues where no matter the project (even a fresh project from a template), I am always getting 404 responses if the static asset path is not at the root directory. I just need some way of debugging this, because its driving me crazy. Config Info:...

Rate-limited

Haven't surpassed the read/write operations limit assume the limit for read operations is 100k and write is 1k while mine remain at 60k and 1k respoectively
No description

worker containers

if a worker is used just for aggregating data from different APIs are the new worker containers beneficial at all for its functionality?

hm

{"response":"HTTP/1.1 400 Bad Request Content-Length: 0 Connection: keep-alive...

accepting connections from CNAMEd domains to our worker

I’m writing a multitenancy app and some customers want their custom domains to point to their subdomain at inploi.app this mostly works fine except i need to add it to wrangler config (or the dashbaord) every freaking time! is there a way i can avoid having to add those? ...
No description

Sveltekit with caching started to received 404 after some time.

So i build sveltekit app using cloudflare adapter. Everything was working fine but at some point I wanted to enable caching from worker (config on screenshot). Then I went offline for 2 hours. After 3 hours i got notified that app is dead when trying to reload dynamic imports. I purged the cache and then rollback caching implementation. I 've got two many requests in console at the time so not sure what is the reason behind this. Is my implementation to access cache invalid ?...
No description

Any way to achieve behavior similar to lambda@edge in cloudfront?

In AWS CloudFront, I can write a function which can perform some verification before allowing a request to reach S3 Objects(Let's say user wants to download some data), here role of lambda is to just to act as a custom gateway which either allows or deny a request. How to achieve this using workers and R2? All I could find from documentation is to use fetch API and return object.body but what if the file size is big and client download time exceeds the max worker execution time? Any way I ca...

how should i redirect http to https and also www to naked root domain?

if i am hosting a site in cloudflare worker, how should i redirect http to https and also www to naked root domain?

How do I specify the routing between frontend and backend?

Currently / is the only route that goes to react. Everything else is sent to the hono worker. Ideally only things prefixed in /api are routed to hono. Currently it's not possible to load some routes on my react app.

Worker log queries have disappeared

I had a bunch of worker log queries defined. Today they're all gone. Are they stored in cookies or some other browser based state, or are they stored on the server? I have multiple computers and was wondering whether they only disappeared on one of them. I'll see tomorrow. Is this a known issue?...

Containers on workers for platform

Is there an ideal workflow to get containers working on "Workers for platforms"?

Is the workflow creation rate limit 100 per 10 seconds for createBatch?

In other words, does the rate limit apply to calls to create or createBatch, or to the absolute number of instances created in a given time window? https://developers.cloudflare.com/workflows/reference/limits/...

How it is calculated 10ms CPU time for free tier

I deployed for workers quiet trivial sveltekit app - retrives data from d1 and sends to the user. I noticed that my worker is exceeding free tier of CPU usage by a lot, but is seems that app is still working. Multiple requests are under 10ms and multiple over 100ms. Will my account be locked-out ? What are rules for killking app which exceeds free plan. Is my app exeed this plan ? Thanks
No description

Does cache rules works with workers?

I've build worker based svelte app. I wanted to cache my data for 8hours (content is really changed). I set up rules cache everyhting (frist screenshot). Then in worker observability logs i see multiple request for GET / which are served within same - small amount of time (screenshot nr 2), why is that? Does cache rules works with workers ?
No description