Jekyll 4.0.0 doesn't build using cache in CI

Viewed 130

Hello I just upgraded my website to Jekyll 4.0.0 and it's starting to take a long time to compile. Up to 10 minutes sometimes. But when I use the incremental build locally it's able to product the compiled version in a few seconds. So I tried to cache all the Jekyll related caches I could find. I'm using CircleCI this is my config.yml

       - save_cache:
           key: site-cache-260320
           paths:
             - _site
             - .jekyll-cache
             - .jekyll-metadata
             - .sass-cache

This restores the cache folders to the repo when the CircleCI job starts. But it doesn't seem like they get reused in the compilation process. The job always takes almost 10 minutes to compile.

Am I missing a cache folder? Is there a Jekyll option I need to use? If I could get my website build/deploys down to a few seconds that would be life changing. Thanks!

1 Answers

The CircleCI documentation on caching also mention

CircleCI restores caches in the order of keys listed in the restore_cache step. Each cache key is namespaced to the project, and retrieval is prefix-matched. The cache will be restored from the first matching key

steps:
  - restore_cache:
      keys:

So make sure to configure your restore_cache step, to go along with your save_cache step.
For instance, be aware of the cache size.

Related