Skip to content

Feature request: Cache cleanup #4774

Open
@TrevorBurnham

Description

@TrevorBurnham

Describe the feature

As a regular CDK user, the ~/Library/Caches/com.amazonaws.jsii dir on my Mac (aka defaultCacheRoot) has steadily grown. It currently stands at over 13GB, mostly made up of old versions of CDK dependencies.

I'd like to request some mechanism for preventing this cache from growing indefinitely.

Use Case

I should be able to use CDK without having to worry about gradually running out of disk space.

Proposed Solution

Two options, which are not mutually exclusive:

  1. Add a documented "clear cache" command to the CDK CLI that would allow users to clear the contents of the JSII cache directory (and possibly other caches as well; my ~/Library/Caches/aws-cdk-lib and ~/Library/Caches/@aws-cdk stand at a total of 3GB).
  2. Add a system for automatically removing items from the cache that have not been used in a certain amount of time (say, 30 days). For example, on each run JSII could touch files that it reads from the cache, then delete all files in the cache whose mtime is over the time limit.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.178.2

Environment details (OS name and version, etc.)

macOS 15.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions