Skip to content

Commit

Permalink
Add warning about SSR features inside layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
yanthomasdev authored Aug 29, 2022
1 parent fa92cd2 commit 8a9e9ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/pages/en/guides/server-side-rendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ You can find instructions at the individual adapter links above to complete the
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.
:::warning
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.
:::
### `Astro.request.headers`
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.
Expand Down

0 comments on commit 8a9e9ed

Please sign in to comment.