Interview Prep/CI/CD/Fundamentals and Pipeline Design

What do pipeline caches do, and how do they differ from artifacts?

IntermediateConceptFundamentals and Pipeline Design
Answer

A cache speeds up later runs by reusing downloaded or computed data (npm modules, Maven ~/.m2, Docker layers). It is best-effort: a miss must never change the outcome, only the speed. Keys are derived from lockfiles, for example hashFiles('**/package-lock.json').

An artifact is a specific output of one run that later jobs (or people) depend on, such as a built binary or a test report. Artifacts are guaranteed to be passed on within the pipeline; caches are not. Never put anything in a cache that the pipeline's correctness depends on.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Fundamentals and Pipeline Design