diff --git a/src/content/docs/en/guides/integrations-guide/netlify.mdx b/src/content/docs/en/guides/integrations-guide/netlify.mdx index 5680018c24680..7c72f01a5ee39 100644 --- a/src/content/docs/en/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/en/guides/integrations-guide/netlify.mdx @@ -248,6 +248,22 @@ With [fine-grained cache control](https://www.netlify.com/blog/swr-and-fine-grai standard caching headers like `CDN-Cache-Control` or `Vary`. Refer to the docs to learn about implementing e.g. time to live (TTL) or stale while revalidate (SWR) caching: https://docs.netlify.com/platform/caching +### Skew Protection + +

+ +Netlify's skew protection ensures that users accessing your site during a deployment continue to receive content from the same deploy version. The Netlify adapter automatically configures skew protection for Astro features like actions, server islands, view transitions, and prefetch requests by injecting the current deploy ID into internal requests. This prevents version mismatches between the client and server during active deployments. + +While Astro automatically adds the skew protection header for its built-in features, if you are making your own fetch requests to your site, you can include the header manually using the `DEPLOY_ID` environment variable: + +```js +const response = await fetch('/api/endpoint', { + headers: { + 'X-Netlify-Deploy-ID': import.meta.env.DEPLOY_ID, + }, +}); +``` + ### Including or excluding files from Netlify Functions When deploying an Astro site with on-demand rendering to Netlify, the generated functions automatically trace and include server dependencies. However, you may need to customize which files are included in your Netlify Functions. diff --git a/src/content/docs/en/reference/adapter-reference.mdx b/src/content/docs/en/reference/adapter-reference.mdx index de3542df0e71f..0a3fe53407f5e 100644 --- a/src/content/docs/en/reference/adapter-reference.mdx +++ b/src/content/docs/en/reference/adapter-reference.mdx @@ -53,6 +53,18 @@ interface AstroAdapter { args?: any; adapterFeatures?: AstroAdapterFeatures; supportedAstroFeatures: AstroAdapterFeatureMap; + client?: { + /** + * Headers to inject into Astro's internal fetch calls (Actions, View Transitions, Server Islands, Prefetch). + * Can be an object of headers or a function that returns headers. + */ + internalFetchHeaders?: Record | (() => Record); + /** + * Query parameters to append to all asset URLs (images, stylesheets, scripts, etc.). + * Useful for adapters that need to track deployment versions or other metadata. + */ + assetQueryParams?: URLSearchParams; + }; } export interface AstroAdapterFeatures {