@@ -6,10 +6,10 @@ products:
66date : 2025-08-07
77---
88
9- import { Render , PackageManagers , TypeScriptExample } from " ~/components"
9+ import { Render , PackageManagers , TypeScriptExample } from " ~/components" ;
1010
1111By setting the value of the ` cache ` property to ` no-cache ` , you can force [ Cloudflare's
12- cache] ( /workers/reference/how-the-cache-works/ ) to revalidate, its contents with the origin when
12+ cache] ( /workers/reference/how-the-cache-works/ ) to revalidate its contents with the origin when
1313making subrequests from [ Cloudflare Workers] ( /workers ) .
1414
1515<TypeScriptExample filename = " index.ts" >
@@ -24,14 +24,19 @@ export default {
2424```
2525</TypeScriptExample >
2626
27- When you set the value to ` no-cache ` on a subrequest made from a Worker, the Cloudflare Workers
28- runtime will force the cache to revalidate its data with the origin
27+ When ` no-cache ` is set, the Worker request will first look for a match in its cache.
28+
29+ If there is a match, a conditional request is sent to the origin, regardless of whether or not the
30+ match is fresh or stale. If the resource has not changed, the cached version is returned. If the resource has changed, it
31+ will be downloaded from the origin, updated in the cache, and returned.
32+
33+ If there is no match in the cache, Workers will make a standard request to the origin and cache the response.
2934
3035This increases compatibility with NPM packages and JavaScript frameworks that rely on setting the
3136[ ` cache ` ] ( /workers/runtime-apis/request/#options ) property, which is a cross-platform standard part
3237of the [ ` Request ` ] ( /workers/runtime-apis/request/ ) interface. Previously, if you set the ` cache `
3338property on ` Request ` to ` 'no-cache' ` , the Workers runtime threw an exception.
3439
35- * Learn [ how the Cache works with Cloudflare Workers] ( /workers/reference/how-the-cache-works/ )
36- * Enable [ Node.js compatibility] ( /workers/runtime-apis/nodejs/ ) for your Cloudflare Worker
37- * Explore [ Runtime APIs] ( /workers/runtime-apis/ ) and [ Bindings] ( /workers/runtime-apis/bindings/ ) available in Cloudflare Workers
40+ - Learn [ how the Cache works with Cloudflare Workers] ( /workers/reference/how-the-cache-works/ )
41+ - Enable [ Node.js compatibility] ( /workers/runtime-apis/nodejs/ ) for your Cloudflare Worker
42+ - Explore [ Runtime APIs] ( /workers/runtime-apis/ ) and [ Bindings] ( /workers/runtime-apis/bindings/ ) available in Cloudflare Workers
0 commit comments