Pcornel
Automation · CI/CD

Caching

Cheat sheet · https://pcornel.dk/topic.php?topic=5512

Back to the Topic

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.

Remember

  • 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.

First checks

  • Cache keys based on lock files — correctness
  • Cache hit rate — effectiveness
  • Cache not used for artefacts/secrets — safety

Verify in this order

lock hash → cache key → restore/save

Where it usually breaks

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

Commit/input → runner/job → build/test artifact → deployment request → target rollout/reconcile → effective version/config → health/readiness → workload.

Caching CI/CD proof-boundary map

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5512

Confirmation

Confirm action

Continue?