GITHUB-ACTIONS practice question 14 of 15

As a developer, you are optimizing a GitHub workflow that uses and produces many different files. You need to determine when to use caching versus workflow artifacts. Which two statements are true? (Choose two.)

Full set: 72 questions
Answer options
A: Use caching when reusing files that change rarely between jobs or workflow runs. Correct answer
B: Use artifacts when referencing files produced by a job after a workflow has ended. Correct answer
C: Use caching to store cache entries for up to 30 days between accesses.
D: Use artifacts to access the GitHub Package Registry and download a package for a workflow
Correct Answer:
A. Use caching when reusing files that change rarely between jobs or workflow runs.; B. Use artifacts when referencing files produced by a job after a workflow has ended.
Explanation

Caching is ideal for files that change rarely, such as dependencies or build outputs, as it speeds up subsequent workflow runs by reusing previously cached files instead of re-downloading or rebuilding them. Artifacts are used for persisting files produced during a job that need to be used in later jobs or after the workflow has ended, allowing them to be downloaded or referenced later.

Scroll to Top