Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/content/docs/workers/runtime-apis/cache.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ The `stale-while-revalidate` and `stale-if-error` directives are not supported w

:::

:::note
Do not use dynamic or invalid hostnames in cache requests. This can cause DNS cache failures and latency.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be more explicit. We should say that the hostname used in the cache request should match your hostname.

And then instead of "DNS cache failures" I'd say "a DNS lookup" which will significantly increase latency.

Copy link
Contributor

@mikenomitch mikenomitch Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if they use "request.headers.host" that'd be the correct hostname to use in all cases? I could be wrong about this though

EDIT: Err... we don't need to specify this since they'll just be passing the whole request object in.

I might say "Do not override the hostname in the request or use a hostname that differs from your own"?

:::

#### Parameters


Expand Down Expand Up @@ -156,6 +160,10 @@ The `stale-while-revalidate` and `stale-if-error` directives are not supported w

:::

:::note
Do not use dynamic or invalid hostnames in cache requests. This can cause DNS cache failures and latency.
:::

#### Parameters


Expand Down
Loading