Skip to content

Commit 0fab43c

Browse files
authored
[Workers] Remove outdated cache API hostname override note (#31094)
1 parent 054afc5 commit 0fab43c

1 file changed

Lines changed: 0 additions & 14 deletions

File tree

  • src/content/docs/workers/runtime-apis

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,6 @@ let myCache = await caches.open('custom:cache');
4848
await myCache.match(request);
4949
```
5050

51-
:::note
52-
53-
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.
54-
55-
```js
56-
// recommended approach: use your Worker hostname to ensure efficient caching
57-
request.url = "https://your-Worker-hostname.com/";
58-
59-
let myCache = await caches.open('custom:cache');
60-
let response = await myCache.match(request);
61-
```
62-
63-
:::
64-
6551
***
6652

6753
## Headers

0 commit comments

Comments
 (0)