diff --git a/src/workerd/api/http-test.wd-test b/src/workerd/api/http-test.wd-test index 8a588eec931..629ab38e36b 100644 --- a/src/workerd/api/http-test.wd-test +++ b/src/workerd/api/http-test.wd-test @@ -11,7 +11,7 @@ const unitTests :Workerd.Config = ( ( name = "SERVICE", service = "http-test" ) ], compatibilityDate = "2023-08-01", - compatibilityFlags = ["nodejs_compat", "service_binding_extra_handlers", "cache_header_enabled"], + compatibilityFlags = ["nodejs_compat", "service_binding_extra_handlers", "cache_option_enabled"], ) ), ], diff --git a/src/workerd/api/http.c++ b/src/workerd/api/http.c++ index e4d8a792d33..2dd1463bd2d 100644 --- a/src/workerd/api/http.c++ +++ b/src/workerd/api/http.c++ @@ -1076,10 +1076,9 @@ jsg::Ref Request::constructor( } KJ_IF_SOME(c, initDict.cache) { - bool cacheHeaderEnabled = FeatureFlags::get(js).getCacheHeaderEnabled(); - if(!cacheHeaderEnabled) { - JSG_FAIL_REQUIRE(TypeError, kj::str("Unsupported cache mode: ", c, "\nYou may need to enable a compatability flag.")); - } + JSG_REQUIRE(FeatureFlags::get(js).getCacheOptionEnabled(), TypeError, kj::str( + "Unsupported cache mode: ", c, + "\nYou may need to enable the cache_option_enabled compatability flag.")); cacheMode = getCacheModeFromName(c); } diff --git a/src/workerd/io/compatibility-date.capnp b/src/workerd/io/compatibility-date.capnp index 3425b4f6669..6c858b3cba2 100644 --- a/src/workerd/io/compatibility-date.capnp +++ b/src/workerd/io/compatibility-date.capnp @@ -505,9 +505,9 @@ struct CompatibilityFlags @0x8f8c1b68151b6cef { $experimental; # Enables of the new module registry implementation. - cacheHeaderEnabled @53 :Bool - $compatEnableFlag("cache_header_enabled") - $compatDisableFlag("cache_header_disabled") + cacheOptionEnabled @53 :Bool + $compatEnableFlag("cache_option_enabled") + $compatDisableFlag("cache_option_disabled") $experimental; # Enables the use of no-cache and no-store headers from requests }