-
-
Notifications
You must be signed in to change notification settings - Fork 16
Cache
ACE comes with in-built functionality of caching mechanism, which is an opt-out feature. Cache is based on saving What If responses coming from ARM endpoints and depending on used cache provider, its behavior might change slightly.
As for now, the only provider available is local cache. Future releases are planned to bring remote locations, which can be used e.g. on ephemeral agents.
Below you can find detailed instruction of how use any of the available providers.
Local cache provider saves cached What If responses as files in the working directory of ACE. Each response is saved as a separate .cache file named as <cache-key>.cache.
ACE uses
.acedirectory to store cached items. User running ACE must have permissions to create that directory and files inside it.
Local cache is meant for scenarios, where agent or machine filesystem is preserved between multiple runs of your pipeline. It won't provide any benefits in scenarios where filesystem gets recreated.
Cache key is calculated as SHA1 hash based on the following values:
- scope ID
- resource group name (if available)
- template content
- parameters values (both inline and from parameters file)
This means, that if you want to invalidate cache, you have two options:
- you modify any of the values used to calculate cache key
- you pass
--disable-cacheflag when running ACE
ACE is unaware of any changes in your cloud infrastructure meaning if there were any changes related to your infrastructure, which might have impacted calculation, you should either include them in your template, or invalidate local cache before performing calculation.
Note, that passing
--disable-cachewon't remove local cache. When you run ACE without that flag, previously created cache keys will still be in your local filesystem meaning they can be reused. Future releases of ACE may introduce different behavior or separate option for refreshing local cache storage. By that time, a workaround is to remove.acedirectory.