From 9707376cf58cf79fa209d4654a84ed960d80fbbd Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Wed, 26 Apr 2023 03:41:17 -0500 Subject: [PATCH 1/3] Iterate on `crossorigin` language in Link preload header comments --- server/lib/set-headers-to-preload-assets.js | 22 +++++++-------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/server/lib/set-headers-to-preload-assets.js b/server/lib/set-headers-to-preload-assets.js index 409eb724..d809422d 100644 --- a/server/lib/set-headers-to-preload-assets.js +++ b/server/lib/set-headers-to-preload-assets.js @@ -29,16 +29,10 @@ function setHeadersToPreloadAssets(res, pageOptions) { // TODO: We should preload fonts as well. // - // We use `cors` because fonts are fetched with "CORS mode 'cors'" (see + // We use `crossorigin` because fonts are fetched with anonymous mode "cors" (see // https://drafts.csswg.org/css-fonts/#font-fetching-requirements) // - // TODO: Should this be `cors` or `crossorigin`? - // https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/#headers shows - // `crossorigin` but - // https://html.spec.whatwg.org/multipage/links.html#link-type-preload (the spec) says - // `cors` so I'm not sure. - // - // `Link: ; rel=preload; as=font; cors` + // `Link: ; rel=preload; as=font; crossorigin` // We use `rel=modulepreload` instead of `rel=preload` for the JavaScript modules // because it's a nice dedicated thing to handle ESM modules that not only downloads @@ -47,14 +41,12 @@ function setHeadersToPreloadAssets(res, pageOptions) { // // Also as a note: `