Because we have more control over how files are deployed to the CDN with Fastly we believe we can have a significantly faster experience when deploying.
What if we could automate any of the issues that user might have when dealing with Fastly?
Taking inspiration from gatsby-plugin-netlify, during `gatsby build`, the gatsby-cloud-plugin generates a _redirects.json file that includes all the redirects found in the code.
Gatsby Cloud Deployer looks for this `_redirects.json` file and then generates the proper vcl files to handle those redirects.
We have gatsbyjs.com building on Fastly and you can see consistent deploy times of between 6 and 7 minutes.
We haven't spent any time optimizing it so this is our baseline.
Generate VCL code for Headers
Again using Netlify as inspiration, we can generate a _headers.json file using the plugin.
Then generate a vcl file in Fastly to handle all the headers.