Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

adamdehaven
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

useRequestURL will return localhost for the host header when utilizing cache strategies, which isn't completely obvious. (It took me 3 days to figure out why my host headers were returning localhost πŸ˜… )

The cache.varies option for Nitro's routeRules needs to be better documented to help understand the cache behavior and discarded headers, especially related to a multi-tenant implementations.

The explanation is not currently obvious when reading through the docs; however, was better explained in #26102 (comment) by @pi0. This PR surfaces the explanation and provides docs visitors a keyword of "tenant" in the docs they can search for as a hint.

I also created a corresponding PR for Nitro: nitrojs/nitro#2241

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Cached responses return localhost for the host since headers are discared. Document the cache.varies
option for multi-tenant environments.
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

nuxt-studio bot commented Mar 11, 2024

βœ… Live Preview ready!

Name Edit Preview Latest Commit
Nuxt Docs Edit on Studio β†—οΈŽ View Live Preview 1b3a16f

@danielroe
Copy link
Member

Thank you! And sorry for not getting back to you sooner on Twitter πŸ™

@danielroe danielroe merged commit 5d3cbff into nuxt:main Mar 11, 2024
@github-actions github-actions bot mentioned this pull request Mar 11, 2024
@adamdehaven adamdehaven deleted the docs/add-discarded-header-docs branch November 20, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants