Azure: Pipeline caching

Dev Shah
Tenets
Published in
3 min readJul 5, 2020

--

Exploring pipeline caching on Azure and it’s shortcomings

In late 2019, Azure DevOps finally released a feature to enable caching on pipelines. Pipeline caching on other platforms like AWS, Bitbucket is pretty straightforward and works like a charm.

Pipeline caching on Azure is slightly different and I’d say it’s still a work in progress. This means on some occasions it might not work as expected.

This article will explain how pipeline caching works on Azure DevOps and address the gotchas.

Cache@2 Task

This task has 3 input arguments -

  1. key (required): unique key to identify the cache
  2. path (required): path of the folder or file you want to cache
  3. restoreKeys (optional): If key fails, this will be the fallback to find cache

Examples

1. Caching NPM’s shared directory (Build)

2. Caching Cypress binary (Test)

--

--

Dev Shah
Tenets

Trying for sarcasm to not takeover while writing about tech, finance & life. Editor of Tenets.