Reduce Azure Pipelines Execution Time | SEO Best Practices for DevOps Solutions | Microsoft Exam AZ-400

Reduce Azure Pipelines Execution Time

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You use Azure Pipelines to build and test a React.js application.

You have a pipeline that has a single job.

You discover that installing JavaScript packages from npm takes approximately five minutes each time you run the pipeline.

You need to recommend a solution to reduce the pipeline execution time.

Solution: You recommend enabling pipeline caching.

Does this meet the goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

A

npm-cache is a command line utility that caches dependencies installed via npm, bower, jspm and composer.

It is useful for build processes that run [npm|bower|composer|jspm] install every time as part of their build process. Since dependencies don't change often, this often means slower build times. npm-cache helps alleviate this problem by caching previously installed dependencies on the build machine.

https://www.npmjs.com/package/npm-cache

Yes, recommending pipeline caching would meet the goal of reducing pipeline execution time in this scenario.

Pipeline caching is a feature provided by Azure Pipelines that allows for caching of files and dependencies between pipeline runs. Caching the JavaScript packages from npm would help in reducing the time required for installing them during each pipeline run.

Enabling pipeline caching is a straightforward process in Azure Pipelines. You can add a Cache task in the pipeline definition file, which would create or restore a cache during each pipeline run, depending on whether a cache already exists or not.

Therefore, by enabling pipeline caching, the pipeline would run faster, and the time taken for installing JavaScript packages from npm would be reduced significantly.