diff --git a/samples/volatile-cache/README.md b/samples/volatile-cache/README.md index 2e2fe674141b..fe4a168f9e83 100644 --- a/samples/volatile-cache/README.md +++ b/samples/volatile-cache/README.md @@ -3,26 +3,11 @@ To run the example on http://localhost:8080 ```sh -$ ./workerd serve config.capnp +$ ./workerd serve --experimental config.capnp ``` To run using bazel ```sh -$ bazel run //src/workerd/server:workerd -- serve ~/cloudflare/workerd/samples/helloworld_esm/config.capnp -``` - -To create a standalone binary that can be run: - -```sh -$ ./workerd compile config.capnp > helloworld - -$ ./helloworld -``` - -To test: - -```sh -% curl http://localhost:8080 -Hello World +$ bazel run //src/workerd/server:workerd -- serve ~/cloudflare/workerd/samples/helloworld_esm/config.capnp --experimental ``` diff --git a/src/workerd/server/server.c++ b/src/workerd/server/server.c++ index bfca0784efde..ddc5c8be4fa1 100644 --- a/src/workerd/server/server.c++ +++ b/src/workerd/server/server.c++ @@ -2423,6 +2423,11 @@ static kj::Maybe createBinding( return makeGlobal(Global::UnsafeEval {}); } case config::Worker::Binding::MEMORY_CACHE: { + if (!experimental) { + errorReporter.addError(kj::str( + "MemoryCache bindings are an experimental feature which may change or go away " + "in the future. You must run workerd with `--experimental` to use this feature.")); + } auto cache = binding.getMemoryCache(); // TODO(cleanup): Should we have some reasonable default for these so they can // be optional?