Checking generated site output into git to speed up build times

I have a Jekyll/Grunt-based site with a large number of image assets that are processed by Jekyll Picture Tag. Build time on first run is quite long on Netlify (close to an hour), but sped up dramatically with the addition of the Jekyll cache build plugin (~3.5 minutes).

It’s not bulletproof, though. Jekyll regenerates the .jekyll-cache directory any time you touch config.yml, and I’ve also experienced deploys that mysteriously kicked off a full site re-build.

Given Netlify’s stateless containers, I’m wondering if it’s not totally insane to start checking my generated _site folder into git? AFAIK, even without Jekyll’s cache the JPT plugin checks if the generated version of images are already present and skips making them if so. In theory, that would dramatically speed up first-run build time and would avoid unexpected full site re-builds later. I tried this on a branch and it seemed to work, but I’m hesitating on fully committing to this route until I could find more info from others who might have run into the same thing. A little Googling + search of this forum didn’t turn up much.

Nuts? Jamstack heresy? I see there are some options like cache-me-outside that maybe could be configured to save just the output of the generated images and avoid this? But just checking everything in might be easier?

Hey @stuntbox,

As long as your repository doesn’t get too bloated for yourself to clone/push, etc. it’s fine to commit that folder in there and then Netlify could use it.