Skip to content

Commit 709262e

Browse files
committed
Updating no-cache changelog for clarity
1 parent 644fa2d commit 709262e

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/content/changelog/workers/2025-08-07-cache-no-cache.mdx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ products:
66
date: 2025-08-07
77
---
88

9-
import { Render, PackageManagers, TypeScriptExample } from "~/components"
9+
import { Render, PackageManagers, TypeScriptExample } from "~/components";
1010

1111
By 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
1313
making 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

3035
This 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
3237
of the [`Request`](/workers/runtime-apis/request/) interface. Previously, if you set the `cache`
3338
property 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

src/content/compatibility-flags/cache-no-cache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ When `no-cache` is specified:
2020
- All requests have the headers `Pragma: no-cache` and `Cache-Control: no-cache` are set on them.
2121

2222
- Subrequests to origins not hosted by Cloudflare force Cloudflare's cache to revalidate with the
23-
origin.
23+
origin.
2424

2525
Examples using `cache: 'no-cache'`:
2626

@@ -33,4 +33,4 @@ The cache value can also be set on a `Request` object.
3333
```js
3434
const request = new Request("https://example.com", { cache: "no-cache" });
3535
const response = await fetch(request);
36-
```
36+
```

0 commit comments

Comments
 (0)