This site runs best with JavaScript enabled.
gatsby

How to speed up gatsby site deployment on Netlify

How to speed up gatsby site deployment on Netlify

KL
Khoa Le
·
How to speed up gatsby site deployment on Netlify

Photo by [Erik Brolin](https://unsplash.com/photos/DGdqJdjq7pA)

This weekend, I built my personal website using Gatsby and deployed it to Netlify so I will do the same.

After 1 day to remove un-necessary things. I'm already to deploy my website to Netlify. The configuration just place in simple file netlify.toml

[[headers]]
  for = "/rss.xml"
  [headers.values]
    Access-Control-Allow-Origin = "*"

[[plugins]]
  package = "netlify-plugin-gatsby-cache"

[build]
  command = "npm run netlify"
  functions = "public/functions/"

What is the netlify-plugin-gatsby-cache plugin? The answer from Jason Lengstorfl is "Persist the Gatsby cache between Netlify builds for huge build speed improvements! ⚡️"

This is the Repo. In there, we can get very detailed about how to install.

Basically, We have 2 ways to install plugin on your application:

[build]
  publish = "public"

[[plugins]]
  package = "netlify-plugin-gatsby-cache"

Next, We continue look and see what is the npm run netlify do? This is a shortcut of gatsby-parallel-runner. After spent 8 hours to setup Google Cloud Function that can use to run parallel gatsby images but I was fail.

And the article that help my life from Netlify is Gatsby Build Speed Improvements With Parallel Image Processing Follow step by step on the local development. I deployed success Google Cloud Function that can help speed up processing images.

Deploy google function no error