Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added notes for cache request hostnames #18634

Open
wants to merge 3 commits into
base: production
Choose a base branch
from

Conversation

ToriLindsay
Copy link
Contributor

Added notes - Do not use dynamic or invalid hostnames in cache requests. This can cause DNS cache failures and latency.

Copy link

cloudflare-workers-and-pages bot commented Dec 9, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8f74b36
Status: ✅  Deploy successful!
Preview URL: https://7b1b8f49.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://tori-pcx6484-cache-hostname.cloudflare-docs-7ou.pages.dev

View logs

Copy link

github-actions bot commented Dec 9, 2024

@@ -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"?

Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

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

Needs more context — show vs. just tell

@ToriLindsay
Copy link
Contributor Author

@mikenomitch @irvinebroque Thank you for the feedback! I updated the note with the details from Mike. An example could also be included if you think that's necessary to show it more explicitly? Let me know your thoughts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product:workers Related to Workers product size/xs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants