Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/content/docs/en/guides/integrations-guide/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,32 @@ export default defineConfig({
});
```

#### `experimentalStaticHeaders`
Comment thread
ArmandPhilippot marked this conversation as resolved.
Outdated
Comment thread
ematipico marked this conversation as resolved.
Outdated

<p>
**Type:** `boolean` <br />
</p>
Comment thread
ematipico marked this conversation as resolved.

If enabled, the adapter will save [static headers in the framework API file](https://docs.netlify.com/frameworks-api/#headers).
Comment thread
ematipico marked this conversation as resolved.
Outdated

Here is the list of the headers that are added:
- The CSP header of the static pages is added when CSP support is enabled.
Comment thread
ematipico marked this conversation as resolved.
Outdated

```js title="astro.config.mjs" {6}
Comment thread
sarah11918 marked this conversation as resolved.
Outdated
import { defineConfig } from 'astro/config';
import netlify from '@astrojs/netlify';

export default defineConfig({
experimental: {
cps: true
Comment thread
sarah11918 marked this conversation as resolved.
Outdated
},
adapter: netlify({
experimentalStaticHeaders: true
})
});
```


## Examples

* The [Astro Netlify Edge Starter](https://github.com/sarahetter/astro-netlify-edge-starter) provides an example and a guide in the README.
Expand Down
26 changes: 26 additions & 0 deletions src/content/docs/en/guides/integrations-guide/node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,32 @@ export default defineConfig({
});
```


### `experimentalStaticHeaders`

<p>
**Type:** `boolean` <br />
</p>
Comment thread
ematipico marked this conversation as resolved.

If enabled, the adapter will serve the headers of the static pages using the `Response` object.
Comment thread
ematipico marked this conversation as resolved.
Outdated

Here is the list of the headers that are added:
- The CSP header of the static pages is added when CSP support is enabled.
Comment thread
ematipico marked this conversation as resolved.
Outdated

```js title="astro.config.mjs" {6}
Comment thread
sarah11918 marked this conversation as resolved.
Outdated
import { defineConfig } from 'astro/config';
import node from '@astrojs/node';

export default defineConfig({
experimental: {
cps: true
Comment thread
sarah11918 marked this conversation as resolved.
Outdated
},
adapter: node({
experimentalStaticHeaders: true
})
});
```

## Usage

First, [performing a build](/en/guides/deploy/#building-your-site-locally). Depending on which `mode` selected (see above) follow the appropriate steps below:
Expand Down