From 5d3cbff6acd2ae364f0ea45f8059c22012ff3360 Mon Sep 17 00:00:00 2001 From: Adam DeHaven <2229946+adamdehaven@users.noreply.github.com> Date: Mon, 11 Mar 2024 10:35:33 -0400 Subject: [PATCH] docs: add cache.varies docs for multi-tenant use case (#26197) --- docs/3.api/2.composables/use-request-url.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/3.api/2.composables/use-request-url.md b/docs/3.api/2.composables/use-request-url.md index a2d4a8e3c81d..1ed09bb66b52 100644 --- a/docs/3.api/2.composables/use-request-url.md +++ b/docs/3.api/2.composables/use-request-url.md @@ -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]