mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
docs: add cache.varies docs for multi-tenant use case (#26197)
This commit is contained in:
parent
06af1cd6d3
commit
5d3cbff6ac
@ -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.
|
`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
|
::code-group
|
||||||
|
|
||||||
```vue [pages/about.vue]
|
```vue [pages/about.vue]
|
||||||
|
Loading…
Reference in New Issue
Block a user