From f82678f1b9f4c07306a5742269839d79aefd4e89 Mon Sep 17 00:00:00 2001 From: Isabelle Ingato Date: Sun, 14 Feb 2021 10:13:16 -0500 Subject: [PATCH] docs(gatsby-plugin-netlify): Update readme (#29168) * docs(gatsby-plugin-netlify): Update readme Add context for mergeLinkHeaders option Fixes #28693 * Typo Remove accidental slash * fix: lint Co-authored-by: Megan Sullivan --- packages/gatsby-plugin-netlify/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/gatsby-plugin-netlify/README.md b/packages/gatsby-plugin-netlify/README.md index ed78c78254b20..7c83c37e7f0bc 100644 --- a/packages/gatsby-plugin-netlify/README.md +++ b/packages/gatsby-plugin-netlify/README.md @@ -70,6 +70,26 @@ any base file names to the hashed variants. If the file is not hashed, it will ensure the path is valid relative to the output `public` folder. You should be able to reference assets imported through javascript in the `static` folder. +When `mergeLinkHeaders` is true, as it is by default, this plugin will generate HTTP preload headers for the asset paths for all of your application's pages. + +An example: + +``` +/my-page + Link: ; rel=preload; as=script + Link: ; rel=preload; as=script + Link: ; rel=preload; as=script + Link: ; rel=preload; as=script + Link: ; rel=preload; as=script + Link: ; rel=preload; as=script + Link: ; rel=preload; as=fetch; crossorigin + Link: ; rel=preload; as=fetch; crossorigin +``` + +Therefore, expect the size of the `_headers` file to grow linearly with the number of pages in your application. + +> **Note:** Gatsby also adds these preload tags in your pages' index.html files, whether or not you are using this plugin. + Do not specify the public path in the config, as the plugin will provide it for you.