Skip to content

[Question] What to cache for CI using the node_modules linker? #2621

Answered by larixer
jasonlimantoro asked this question in Q&A
Discussion options

You must be logged in to vote

The approach to caching heavily depends on the project and the CI. Sometimes CI cache compression and decompression takes more time, than Yarn downloading artifacts from the registry, in this case caching .yarn/cache not worth it. Caching all node_modules locations and .yarn/install-state.gz should more often then not be beneficial, because any native tool typically creates a lot of files much faster than Node.js, plus you will avoid rebuilding your install-time dependencies. Also, make sure to use compressionLevel: 0 in .yarnrc.yml if you are on Yarn 2 or 3, (it is 0 by default on Yarn 4+) if you use node-modules linker all the time, this affects install times very much.

Replies: 8 comments 23 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
19 replies
@theolavaux
Comment options

@Lonli-Lokli
Comment options

@Zainakbar786
Comment options

@Lonli-Lokli
Comment options

@xg-wang
Comment options

Answer selected by jasonlimantoro

This comment was marked as spam.

This comment was marked as spam.

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@williamworse
Comment options

Comment options

You must be logged in to vote
1 reply
@belgattitude
Comment options

Comment options

You must be logged in to vote
2 replies
@larixer
Comment options

larixer May 5, 2023
Collaborator

@belgattitude
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #2620 on March 20, 2021 07:50.