Skip to content

Commit 3d7bdaa

Browse files
committed
Fixed
1 parent 42cbc17 commit 3d7bdaa

File tree

1 file changed

+6
-5
lines changed
  • src/content/docs/workers/runtime-apis

1 file changed

+6
-5
lines changed

src/content/docs/workers/runtime-apis/cache.mdx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,13 @@ await myCache.match(request);
5151
```
5252
When using the cache API, avoid overriding the hostname in cache requests, as this can lead to unnecessary DNS lookups and cache inefficiencies. Always use the hostname that matches the domain associated with your Worker.
5353

54-
```async fetch(request, env, ctx) {
55-
// avoid overriding the request URL or passing a new request into the cache API
56-
request.url = "https://some-overridden-value.com";
54+
```js
55+
async fetch(request, env, ctx) {
56+
// avoid overriding the request URL or passing a new request into the cache API
57+
request.url = "https://some-overridden-value.com";
5758

58-
let myCache = await caches.open('custom:cache');
59-
await myCache.match(request);
59+
let myCache = await caches.open('custom:cache');
60+
await myCache.match(request);
6061
},
6162
```
6263
***

0 commit comments

Comments
 (0)