Skip to content

Commit

Permalink
docs: add cache.varies docs for multi-tenant use case (#26197)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Mar 11, 2024
1 parent 06af1cd commit 5d3cbff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/3.api/2.composables/use-request-url.md
Expand Up @@ -10,6 +10,12 @@ links:

`useRequestURL` is a helper function that returns an [URL object](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) working on both server-side and client-side.

::important
When utilizing [Hybrid Rendering](/docs/guide/concepts/rendering#hybrid-rendering) with cache strategies, all incoming request headers are dropped when handling the cached responses via the [Nitro caching layer](https://nitro.unjs.io/guide/cache) (meaning `useRequestURL` will return `localhost` for the `host`).

You can define the [`cache.varies` option](https://nitro.unjs.io/guide/cache#options) to specify headers that will be considered when caching and serving the responses, such as `host` and `x-forwarded-host` for multi-tenant environments.
::

::code-group

```vue [pages/about.vue]
Expand Down

0 comments on commit 5d3cbff

Please sign in to comment.