Make cache size and expiry configurable via environment variables by Man7asP · Pull Request #5576 · wp-cli/wp-cli

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@Man7asP

Copy link

Contributor

@Man7asP Man7asP commented

Nov 4, 2021

edited by schlessera

Loading

The WP-CLI file cache can now be configured via the following environment variables:

  • WP_CLI_CACHE_DIR - Directory in which to store the cached files. Default value: "$home/.wp-cli/cache".
  • WP_CLI_CACHE_EXPIRY - Time after which cached files are automatically purged, in seconds. Default value: 15552000 (6 months).
  • WP_CLI_CACHE_MAX_SIZE - Total size of the file cache after which older files are purged, in bytes. Default value: 314572800 (300MB).

Fixes #5574

@Man7asP Man7asP requested a review from a team as a code owner

November 4, 2021 14:15

@schlessera schlessera added this to the 2.5.1 milestone

Nov 4, 2021

@schlessera schlessera merged commit aa182a8 into wp-cli:master

Nov 5, 2021

@schlessera

Copy link

Member

Thanks for the PR, @mn7zDev !

@schlessera schlessera changed the title Cache: Changeable cache size. Make cache size and expiry configurable via environment variables

Nov 5, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@schlessera schlessera schlessera approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

2.6.0

Development

Successfully merging this pull request may close these issues.

Cache: Change file cache size

2 participants

@Man7asP @schlessera