Skip to content

Commit 8a9e9ed

Browse files
authored
Add warning about SSR features inside layouts
1 parent fa92cd2 commit 8a9e9ed

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/pages/en/guides/server-side-rendering.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ You can find instructions at the individual adapter links above to complete the
4747
4848
Astro will remain a static-site generator by default. But once you enable a server-side rendering adapter, **every route in your pages directory becomes a server-rendered route** and a few new features become available to you.
4949
50+
:::warning
51+
The features below are not available inside layouts nor components. Because of streaming, things like headers and status codes can only be sent once, and by the time a layout or component is rendered, this had already happened.
52+
:::
53+
5054
### `Astro.request.headers`
5155
5256
The headers for the request are available on `Astro.request.headers`. It is a [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers) object, a Map-like object where you can retrieve headers such as the cookie.

0 commit comments

Comments
 (0)