From 429b2db5b6303f21b29b1190b2ad5ce85d266af4 Mon Sep 17 00:00:00 2001 From: Isabelle Ingato Date: Sun, 24 Jan 2021 18:44:07 -0500 Subject: [PATCH 1/3] docs(gatsby-plugin-netlify): Update readme Add context for mergeLinkHeaders option Fixes #28693 --- 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..d2d0b2bed8b95 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. From e07c073d65395bf2302a87b40d602d005447ac2d Mon Sep 17 00:00:00 2001 From: Isabelle Ingato Date: Sun, 24 Jan 2021 18:56:26 -0500 Subject: [PATCH 2/3] Typo Remove accidental slash --- packages/gatsby-plugin-netlify/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-netlify/README.md b/packages/gatsby-plugin-netlify/README.md index d2d0b2bed8b95..0dab82bf04870 100644 --- a/packages/gatsby-plugin-netlify/README.md +++ b/packages/gatsby-plugin-netlify/README.md @@ -86,7 +86,7 @@ An example: 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. +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. From 00a485f138d1a39f8e3cc41d455c9d2e20f8cb97 Mon Sep 17 00:00:00 2001 From: Megan Sullivan Date: Wed, 27 Jan 2021 10:07:10 -0800 Subject: [PATCH 3/3] fix: lint --- packages/gatsby-plugin-netlify/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gatsby-plugin-netlify/README.md b/packages/gatsby-plugin-netlify/README.md index 0dab82bf04870..7c83c37e7f0bc 100644 --- a/packages/gatsby-plugin-netlify/README.md +++ b/packages/gatsby-plugin-netlify/README.md @@ -86,7 +86,7 @@ An example: 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. +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.