# LocalCacheMode

Local cache modes to enable for the CodeBuild Project.

- Source: [`aws-codebuild/lib/cache.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-codebuild/lib/cache.ts#L26)

## Example

```ts
new codebuild.Project(this, 'Project', {
  source: codebuild.Source.gitHubEnterprise({
    httpsCloneUrl: 'https://my-github-enterprise.com/owner/repo',
  }),

  // Enable Docker AND custom caching
  cache: codebuild.Cache.local(codebuild.LocalCacheMode.DOCKER_LAYER, codebuild.LocalCacheMode.CUSTOM),

  // BuildSpec with a 'cache' section necessary for 'CUSTOM' caching. This can
  // also come from 'buildspec.yml' in your source.
  buildSpec: codebuild.BuildSpec.fromObject({
    version: '0.2',
    phases: {
      build: {
        commands: ['...'],
      },
    },
    cache: {
      paths: [
        // The '**/*' is required to indicate all files in this directory
        '/root/cachedir/**/*',
      ],
    },
  }),
});
```

## Members

| Member | Description |
| --- | --- |
| `SOURCE` | Caches Git metadata for primary and secondary sources. |
| `DOCKER_LAYER` | Caches existing Docker layers. |
| `CUSTOM` | Caches directories you specify in the buildspec file. |
