After upgrading to Gatsby v3 I noticed builds on netlify seemed to be taking a long time.
The main component taking time on builds seemed to be netlify cms.
NetlifyCMS React Component #
Changed netlify-cms to use external pre-built js to speed up build times.
The main difference between using the netlify cms react component & using pre-built js from netlify is the post preview when editing in netlify cms.
It is possible to set custom css styles for the preview pane on pre-built netlify-cms using
Cleanup Dependencies #
Removed some dependencies which are no longer required for the blog.
Deploy Times #
netlify.toml Tweaks #
As I had disabled gatsby-plugin-netlify due to a problem with webpack on upgrading gatsby I added some default header rules with basic security headers.
Default Header Rules #
X-Frame-Options = "DENY" X-XSS-Protection = "1; mode=block" X-Content-Type-Options = "nosniff" Referrer-Policy = "same-origin"
A cool feature with netlify is the ability to set redirects allowing me to redirect common RSS uri's (
Redirects can also forward to external websites.
I added redirects to my github & twitter profiles. (
[[redirects]] from = "/github" to = "https://github.com/equk" status = 301 force = true
The source for the site is available on github.