Should I add .jekyll-cache changes in my commits?

Should I add .jekyll-cache/ changes in my commits? Not sure about it and I can’t find information related to this topic.


I can’t point you to documentation about it, but I would say no. The cache is for the build process, and submitting the cache to your repo will do nothing to improve or speed up the process. In fact, it might harm the build process on a server that is not your local environment. Your local cache and the server cache should be two different things with distinct config files in some cases. I have a local config.yml file for my local storage paths and config__prod.yml for production, for example. I can’t say with authority that this advice should be followed but that is what my gut tells me.

The answer above is correct. You don’t want to add any cache generated on a specific build or machine to the repo.

Jekyll 4 adds caching to store results of deterministic functions to make builds faster.

Cache by it’s very nature is temporary so shouldn’t be fixed and if it was it would be named something else.

Here is my ignore file built in minima and jekyll quickstart. It ignores jekyll cache, jekyll metadata, sass cache and other things.


Thank you for the explanation @jhogue, and thank you @MichaelCurrin for sharing your .gitignore, because that was going to be my next question. I am upgrading my project to Jekyll 4 and this has been one of my key challenges.