Skip to content

Commit 077b5f7

Browse files
committed
Changed to recommended approach
1 parent ebeb2d8 commit 077b5f7

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ await myCache.match(request);
5353
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.
5454

5555
```js
56-
// Do not do this
57-
request.url = "https://some-overridden-value.com/";
56+
// recommended approach: use your Worker hostname to ensure efficient caching
57+
request.url = "https://your-Worker-hostname.com/";
5858

5959
let myCache = await caches.open('custom:cache');
6060
let response = await myCache.match(request);

0 commit comments

Comments
 (0)