Replacement of origin server by Worker KV (without Workers programming)

Is it possible to directly use KV values as a source for CDN cache? With all the benefits that edge cdn cache offers:

  • extremely robust and fast multipart byte range request
  • cf-status: HIT x MISS x …
  • request to origin (KV) only when the asset is removed from the cache (after long-term inactivity)

Thanks

It sounds like you want to use Workers KV…but without Workers? Someone is going to have to program that.

1 Like

exactly.
Before I dive into the Worker API documentation: how challenging can it be?
Just test if the asset is not in cache. If no, analyze the request, take the key, fill the cache by value and return it.

How good are you at programming in JavaScript?

Javascript (Typescript) is no problem for me.
I just don’t know the Worker API and cache workflow. I suppose the Worker code is called before reading from the cache.
But it probably wouldn’t be pleasant to compose a multipart range cache response. Just fill the cache a let Cloudflare work …

Perhaps?

1 Like

It sounds like they want to permanently store cached assets in KV.

just replace my origin server (Azure blob storage now, which does not allow multipart range request) with other cloud storage (KV). I was hoping to find a ready-made solution (as KeyCDN and Bunny has).

I’m just reading the doc and examples, it shouldn’t be a problem.

The Wrangler setup from @cs-cf is pretty easy. And if you’re a Github user, the upcoming Pages product will be another option.

https://pages.cloudflare.com/

Ok, thanks a lot for info.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.