It should use HTTP 2 by default. It looks like all the requests that are HTTP 1.1 from the iamdeveloper domain are being loaded by a service worker. I reckon that has something to do with it.
I deployed my prodution and staging site on Netlify and I got reports from Lighthouse audits that some my resources are being served in HTTP/1.1 protocol which it shouldn't do that.
I found out later that all of the resurces that being served in HTTP/1.1 are from ServiceWorker. I think there's some issue with gatsby-plugin-offine
Steps to reproduce
Open DevTools with Network tab
Go to blog-staging.rayriffy.com. From this point you can see all resources are downloaded in HTTP/2 protocol
Refresh page. And you should see cached data from ServiceWorker are served in HTTP/1.1
Expected result
ServiceWorker should serve cache in HTTP/2 protocol
It should use HTTP 2 by default. It looks like all the requests that are HTTP 1.1 from the iamdeveloper domain are being loaded by a service worker. I reckon that has something to do with it.
Yeah that was what @easyaspython had guessed. So I guess a false reading from lighthouse?
It's apparently a bug with Chrome and Lighthouse.
Description
I deployed my prodution and staging site on Netlify and I got reports from Lighthouse audits that some my resources are being served in HTTP/1.1 protocol which it shouldn't do that.
I found out later that all of the resurces that being served in HTTP/1.1 are from ServiceWorker. I think there's some issue with
gatsby-plugin-offineSteps to reproduce
Expected result
ServiceWorker should serve cache in HTTP/2 protocol
Actual result
It served in HTTP/1.1 protocol
Environment
gatsby-config.js
Source
package.json
Source
{ "name": "rayriffy-blog", "description": "The Nerdy Blogger", "version": "1.0.10", "author": "Phumrapee Limpianchop <contact@rayriffy.com>", "bugs": { "url": "https://github.com/rayriffy/rayriffy-blog/issues" }, "dependencies": { "cross-env": "^5.2.0", "gatsby": "^2.0.91", "gatsby-image": "^2.0.26", "gatsby-paginate": "^1.0.16", "gatsby-plugin-feed": "^2.0.8", "gatsby-plugin-google-analytics": "^2.0.9", "gatsby-plugin-google-fonts": "^0.0.4", "gatsby-plugin-manifest": "^2.0.13", "gatsby-plugin-netlify": "^2.0.5", "gatsby-plugin-netlify-cache": "^1.0.0", "gatsby-plugin-offline": "^2.0.21", "gatsby-plugin-react-helmet": "^3.0.5", "gatsby-plugin-robots-txt": "^1.3.0", "gatsby-plugin-sharp": "^2.0.17", "gatsby-plugin-sitemap": "^2.0.4", "gatsby-plugin-typography": "^2.2.5", "gatsby-remark-copy-linked-files": "^2.0.8", "gatsby-remark-embed-gist": "^1.1.5", "gatsby-remark-embed-spotify": "^2.0.2", "gatsby-remark-images": "^3.0.1", "gatsby-remark-prismjs": "^3.2.0", "gatsby-remark-responsive-iframe": "^2.0.8", "gatsby-remark-smartypants": "^2.0.5", "gatsby-source-filesystem": "^2.0.16", "gatsby-transformer-json": "^2.1.7", "gatsby-transformer-remark": "^2.2.0", "gatsby-transformer-sharp": "^2.1.10", "lodash": "^4.17.11", "prismjs": "^1.15.0", "prop-types": "^15.6.2", "react": "^16.7.0", "react-adsense": "^0.0.6", "react-dom": "^16.7.0", "react-helmet": "^5.2.0", "react-icons": "^3.3.0", "react-typography": "^0.16.18", "riffy-gjs-embeded-video": "^1.3.1", "typeface-merriweather": "0.0.54", "typeface-montserrat": "0.0.43", "typography": "^0.16.17" }, "devDependencies": { "babel-eslint": "^10.0.1", "eslint": "^5.12.0", "eslint-config-prettier": "^3.5.0", "eslint-config-standard": "^12.0.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-node": "^8.0.1", "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-promise": "^4.0.1", "eslint-plugin-react": "^7.12.3", "eslint-plugin-standard": "^4.0.0", "prettier": "^1.14.2" }, "homepage": "https://blog.rayriffy.com", "keywords": [ "gatsby", "gatsbyjs", "react", "reactjs", "es6", "blog" ], "license": "MIT", "main": "n/a", "repository": { "type": "git", "url": "git+https://github.com/rayriffy/rayriffy-blog.git" }, "scripts": { "dev": "cross-env GATSBY_ENV=development gatsby develop --https", "dev-staging": "cross-env GATSBY_ENV=staging gatsby develop --https", "dev-prod": "cross-env GATSBY_ENV=production gatsby develop --https", "lint": "./node_modules/.bin/eslint --ext .js,.jsx --ignore-pattern public .", "test": "echo \"Error: no test specified\" && exit 1", "format": "prettier --trailing-comma es6 --no-semi --single-quote --write 'src/**/*.js' 'src/**/*.md'", "develop": "cross-env GATSBY_ENV=development gatsby develop --https", "start": "npm run develop", "build": "cross-env GATSBY_ENV=production gatsby build", "build-staging": "cross-env GATSBY_ENV=staging gatsby build", "deploy": "gatsby build --prefix-paths", "fix-semi": "eslint --quiet --ignore-pattern node_modules --ignore-pattern public --parser babel-eslint --no-eslintrc --rule '{\"semi\": [2, \"never\"], \"no-extra-semi\": [2]}' --fix gatsby-node.js" } }gatsby-node.js
Source
PS. I will drop repository here github.com/rayriffy/rayriffy-blog
It happens in Firefox as well. I think that bug is probably in that gatsby plugin. I've seen service workers use HTTP 2 for loading content before.