# Cache

## Introduction

VyBuild integrate its own cache, stored in the `.vybuild_cache` folder in the root of the project folder, identified using `getcwd` at the start of the build pipeline execution. It is recommanded to put this folder in your `.gitignore` file if you use Git, or any other equivalent source control software.

## Smart cache

To ensure that the cache only contains what is actually needed for efficient compilation without taking too much storage, VyBuild integrate a unique technology called smart cache. The smart cache is enabled by default and ensure that the cache remain reasonably small on disk.

Instead of relying on metadata like file dates or complex dependency graphs, the smart cache acts at the root of the root of the cache subsystem, and it works even on custom build artifacts stored in cache by the user. It is built upon three simple rules:
- any new cache object that has been created during this build pipeline execution remains in cache
- any cache object that was already in the cache before this build pipeline execution, and that have been used/extracted from the cache during this build pipeline execution remains in cache
- any cache object that was already in the cache before this build pipeline execution, and that hasn't been used/extracted from the cache during this build pipeline execution will be deleted at the end of this build pipeline execution
