Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Caching · CI/CD

Direct answer

CI/CD Caching reuses dependency or intermediate data across jobs/runs to reduce execution time, but cache identity and trust must be separated from release artifacts.

When to use this

Use it when configuring, checking or troubleshooting Caching in CI/CD.

First 30 seconds

1. Caching speeds up dependency installs/builds.

2. Key on lock file hashes.

3. Don't cache secrets.

4. Cache poisoning risk from untrusted PRs — scope caches.

5. Measure hit rates.

Operational verification

lock hash → cache key → restore/save

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
CI/CD dependency caching
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformCI/CD dependency caching · Automation → CI/CD owns vendor-neutral pipeline evaluation, execution workers, artifacts, build/test/release/deployment workflow, approvals, environments, variables/secrets usage, caching/concurrency, rollback and pipeline troubleshooting. Git owns repository semantics; Security owns credential governance; GitHub Actions/Jenkins own platform-specific behavior; target Domains own runtime implementation and service acceptance.
Scope / prerequisiteUse it when configuring, checking or troubleshooting Caching in CI/CD.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Operational evidence path Verify boundary

Healthy evidence: Cache keys include the relevant dependency/platform context, misses remain safe, untrusted writers cannot poison protected consumers and artifacts remain independently identified.

Step 2 Verification path Verify boundary

Record pipeline/run/job, commit SHA, runner, cache/artifact key and deployment target IDs; inspect the runtime/control-plane result; then query build/test artifacts, caches and any deployed application/infrastructure state through an independent read path and compare it with the versioned intent. For CI/CD → Caching, the evidence must connect the control-plane result to build/test artifacts, caches and any deployed application/infrastructure state and explain any gap between desired, controller-reported and consumer-visible state.

Step 3 Failure modes and next checks Narrow the fault

Suspicious evidence: Broad fallback keys restore stale or attacker-controlled dependencies, or a cache is promoted as if it were an immutable release artifact.

Step 4 Where it fails Narrow the fault

Common failure classes include stale/poisoned cache, key collision, runner drift, artifact mix-up, partial matrix failure and green pipeline with bad deployment. Before retrying a mutating operation, read current target state using the stable identity pipeline/run/job, commit SHA, runner, cache/artifact key and deployment target IDs; if state is unknown, stop broad retries.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Cache hit ≠ cache correct or trusted; cache keys, restore fallback, platform/architecture and poisoning boundaries can change the effective build inputs.
  • Pipeline status is execution evidence, not independent proof of target service health or business outcome.
  • The exact revision, evaluated pipeline definition, effective inputs and execution worker are part of the evidence context.
  • Preserve artifact identity and target read-back so validation, promotion and runtime acceptance cannot be silently conflated.
Key checks
  • Cache keys based on lock files — correctness
  • Cache hit rate — effectiveness
  • Cache not used for artefacts/secrets — safety
ReferenceWhat it is1 section · depth on demand

In depth

Caching in CI/CD stores dependencies or build outputs between pipeline runs — pip packages, Ansible collections, Terraform providers, container layers — so jobs do not download or rebuild them every time.

Good cache keyWhy
Hash of the lock file (requirements.txt, .terraform.lock.hcl)Invalidates when dependencies change
OS and tool versionAvoid incompatible binaries

Caches speed up pipelines but can hide problems (a missing dependency that is only present in the cache). Rebuild without cache periodically and never cache secrets.

ReferenceWhy it matters1 section · depth on demand

Common mistakes

  • Cache keys that never change, serving stale dependencies.
ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

Cache hit ≠ cache correct or trusted; cache keys, restore fallback, platform/architecture and poisoning boundaries can change the effective build inputs.

Mechanics

CI/CD → Caching is owned at runtime by the CI/CD scheduler and runner executing jobs with caches/artifacts and external deployment targets. Its durable intent is versioned pipeline/workflow definition with dependency/cache keys, runner/tool versions and deployment policy; the stable identity contract is pipeline/run/job, commit SHA, runner, cache/artifact key and deployment target IDs. The consumer-visible target is build/test artifacts, caches and any deployed application/infrastructure state. The operating invariants are that source revision is exact, caches are keyed safely, cache hits never replace correctness checks, artifacts are traceable and external deployments are independently verified. Follow the chain of components SCM revision → pipeline scheduler → runner → cache/dependency restore → build/test → artifact/deploy → target read-back and record which layer currently owns truth. The linked authority for bounded mechanics is GitHub Docs — Dependency caching reference; documentation support is separate from observed lab/production Evidence.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docCI/CD dependency caching current

Authoritative/upstream documentation reviewed for bounded claims in CI/CD > Caching. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
Cachingpipeline cacheCI cache
Embedded reference data

Quick lookup tables

Caching CI/CD proof-boundary map

Fast trigger/execution/artifact/promotion/target-proof boundaries for Caching.

BoundaryHealthy evidenceSuspicious evidence
Trigger / evaluationExact commit and evaluated pipeline/inputs are knownWrong ref, inherited rule or hidden variable changes the run
Execution / validationExpected worker, jobs and tests execute with traceable contextSkips, retries, stale cache or worker drift hides the failure
Artifact / promotionImmutable artifact is linked to release, approval and environmentRebuild/mutable tag breaks provenance or approval scope
Target proofRollout plus independent readiness/acceptance confirms the intended releasePipeline/API success is treated as runtime health
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Capture at minimum repo/SHA, run/job, runner, cache key/hit, artifact digest, test result, deployment ID and final service state.

Confirmation

Confirm action

Continue?