Community Plugin
View plugin on GitHubgatsby-adapter-netlify
This adapter enables following features on Netlify:
- Redirects
- HTTP Headers
- Application of default caching headers
- Deferred Static Generation (DSG)
- Server-Side Rendering (SSR)
- Gatsby Functions
- Caching of builds between deploys
This adapter is part of Gatsby’s zero-configuration deployments feature and will be installed automatically on Netlify. You can add gatsby-adapter-netlify
to your dependencies
and gatsby-config
to have more robust installs and to be able to change its options.
Installation
npm install gatsby-adapter-netlify
Usage
Add gatsby-adapter-netlify
to your gatsby-config
and configure the adapter
option.
const adapter = require("gatsby-adapter-netlify")
module.exports = {
adapter: adapter({
excludeDatastoreFromEngineFunction: false,
}),
}
Options
excludeDatastoreFromEngineFunction (optional, default: false
)
If true
, Gatsby will not include the LMDB datastore in the serverless functions used for SSR/DSG. Instead, it will upload the datastore to Netlify’s CDN and download it on first load of the functions.