Add Workers Cache (ctx.cache.purge) to Miniflare #14734
timhanlon
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm currently working on an implementation of Workers Cache. As far as I can tell there’s no local dev story, and the only way to test purge behaviour is deploying to a preview environment on Cloudflare and running E2E tests against it.
The gap turns out to be small. workerd already ships the JS surface scaffolding (api::CacheContext, the purge structs, and the Worker::Api::getCtxCacheProperty() hook), but standalone workerd returns kj::none from the hook, so ctx.cache is undefined under Miniflare. Miniflare's cache simulator already implements the HTTP cache protocol for match/put/delete — it just has no purge-by-tag route.
I got my agents to build a working proof-of-concept across both repos:
Diffs against upstream main: workerd, workers-sdk
I'm happy to open PRs for both if that would be helpful, though I'm not a regular contributor, and this is my first exposure to C++ in about 20 years.
All reactions