From f401d69b49be7064d036027290a00a68730c0be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Mon, 24 Jul 2017 12:49:24 +0200 Subject: [PATCH] Load CSS and JS via HTTP/2 server push MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://www.netlify.com/blog/2017/07/18/http/2-server-push-on-netlify/ ``` ▶ nghttp -ans https://deploy-preview-83--gohugoio.netlify.com/ ***** Statistics ***** Request timing: responseEnd: the time when last byte of response was received relative to connectEnd requestStart: the time just before first byte of request was sent relative to connectEnd. If '*' is shown, this was pushed by server. process: responseEnd - requestStart code: HTTP status code size: number of bytes received as response body without inflation. URI: request URI see http://www.w3.org/TR/resource-timing/#processing-model sorted by 'complete' id responseEnd requestStart process code size request path 13 +199.52ms +1.22ms 198.30ms 200 42K / 4 +404.60ms * +69.97ms 334.62ms 200 102K /dist/main.css 2 +484.93ms * +69.63ms 415.30ms 200 131K /dist/app.bundle.js ``` Compare that to the live site: ``` ▶ nghttp -ans https://gohugo.io/ ***** Statistics ***** Request timing: responseEnd: the time when last byte of response was received relative to connectEnd requestStart: the time just before first byte of request was sent relative to connectEnd. If '*' is shown, this was pushed by server. process: responseEnd - requestStart code: HTTP status code size: number of bytes received as response body without inflation. URI: request URI see http://www.w3.org/TR/resource-timing/#processing-model sorted by 'complete' id responseEnd requestStart process code size request path 13 +596.97ms +2.54ms 594.43ms 200 42K / 15 +606.87ms +403.50ms 203.37ms 200 15K /files/muli-latin-200.woff2 2`1 +790.39ms +403.51ms 386.88ms 200 20K /dist/main.css 23 +1.14s +596.00ms 544.48ms 200 42K /dist/app.bundle.js 19 +1.14s +403.50ms 737.99ms 200 15K /files/muli-latin-800.woff2 17 +1.14s +403.50ms 738.01ms 200 15K /files/muli-latin-400.woff2 ``` --- config.toml | 8 ++++++-- static/_headers | 5 ----- themes/gohugoioTheme | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) delete mode 100644 static/_headers diff --git a/config.toml b/config.toml index 08c72176f..badb02781 100644 --- a/config.toml +++ b/config.toml @@ -25,7 +25,7 @@ pygmentsCodeFences = true pygmentsStyle = "friendly" [outputs] -home = [ "HTML", "RSS", "REDIR" ] +home = [ "HTML", "RSS", "REDIR", "HEADERS" ] section = [ "HTML", "RSS"] [mediaTypes] @@ -39,7 +39,11 @@ mediatype = "text/netlify" baseName = "_redirects" isPlainText = true notAlternative = true - +[outputFormats.HEADERS] +mediatype = "text/netlify" +baseName = "_headers" +isPlainText = true +notAlternative = true [social] twitter = "GoHugoIO" diff --git a/static/_headers b/static/_headers deleted file mode 100644 index 1216e42d4..000000000 --- a/static/_headers +++ /dev/null @@ -1,5 +0,0 @@ -/* - X-Frame-Options: DENY - X-XSS-Protection: 1; mode=block - X-Content-Type-Options: nosniff - Referrer-Policy: origin-when-cross-origin diff --git a/themes/gohugoioTheme b/themes/gohugoioTheme index a12544f00..ce4449747 160000 --- a/themes/gohugoioTheme +++ b/themes/gohugoioTheme @@ -1 +1 @@ -Subproject commit a12544f00e3f50450eae1c1108c71eefb71f327f +Subproject commit ce4449747bb1867d7d8b0c579be2ddf4a040274c