Skip to content

Say that 0 turns the cache limits off - #684

Merged
schlessera merged 1 commit into
wp-cli:mainfrom
ekamran:shifteq/cache-limit-zero
Dec 1, 2026
Merged

schlessera merged 1 commit into
wp-cli:mainfrom
ekamran:shifteq/cache-limit-zero

Conversation

@ekamran

@ekamran ekamran commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds one sentence to the WP_CLI_CACHE_EXPIRY and WP_CLI_CACHE_MAX_SIZE entries in the Config reference: since WP-CLI 3.0.0, 0 turns that limit off. This comes from wp-cli/wp-cli#6453. Before that change, 0 fell back to the default instead of turning the limit off.

Changes

  • WP_CLI_CACHE_EXPIRY: adds "Since WP-CLI 3.0.0, 0 turns this limit off."
  • WP_CLI_CACHE_MAX_SIZE: adds the same sentence.

Verification

Read the limits WP_CLI::get_cache() builds, with both variables unset, set to 0 and set to 3600:

Unset 0 3600
wp-cli/wp-cli main at dc9df32 15552000 / 314572800 0 / 0 3600 / 3600
WP-CLI 2.12.0 15552000 / 314572800 15552000 / 314572800 3600 / 3600

With a limit of 0, FileCache::clean() skips removing expired files ($ttl > 0) and skips trimming to size ($max_size > 0).

Ran git diff --check.

Use of AI

AI assistance: Yes
Tool(s): Claude Code and Codex
Used for: checking the limits on main and 2.12.0, drafting the change, and reviewing it. I reviewed the reasoning and test results, and I take responsibility for the contribution.

Summary by CodeRabbit

  • Documentation
    • Clarified that setting either cache limit to 0 turns it off in WP-CLI 3.0.0 and later.

Since WP-CLI 3.0.0, setting WP_CLI_CACHE_EXPIRY or
WP_CLI_CACHE_MAX_SIZE to 0 turns that limit off instead of falling
back to the default. Add that to both entries.
@ekamran
ekamran requested a review from a team as a code owner November 29, 2026 14:55
@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The configuration reference now states that, starting with WP-CLI 3.0.0, setting WP_CLI_CACHE_EXPIRY or WP_CLI_CACHE_MAX_SIZE to 0 disables the corresponding limit.

Changes: Cache limit documentation

Layer / File(s) Summary
Document cache limit behavior
references/config.md
The descriptions for WP_CLI_CACHE_EXPIRY and WP_CLI_CACHE_MAX_SIZE now state that setting either value to 0 disables its limit, starting with WP-CLI 3.0.0.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

  • wp-cli/handbook#677: Adds the two cache settings to the configuration reference; this change updates their descriptions.

Suggested labels: scope:documentation

Suggested reviewers: swissspidy, schlessera

Merge Risk: Minimal · up to 5826b

This documentation-only change says that, since WP-CLI 3.0.0, setting either cache limit to 0 turns it off. It does not change runtime behavior and carries no meaningful merge risk.

Architecture risk: Low · up to 5826b

The change affects 1 source area.

For WP-CLI 3.0.0 and later, when a user sets either cache limit to 0, the reference states that WP-CLI disables that corresponding limit, so users can rely on zero as the documented opt-out.

Changed areas: references

Review details

Systems and components

  • observed — 1 changed file mapped to references.

Before / after behavior

  • observed — Modified behavior in references/config.md: The cache expiry and maximum-size descriptions now document that, since WP-CLI 3.0.0, a value of 0 disables the corresponding limit.
Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Say that 0 turns the cache limits off" matches the main change in the changeset. The PR adds a sentence to the WP_CLI_CACHE_EXPIRY and WP_CLI_CACHE_MAX_SIZE entries in references/config.md.…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Say that 0 turns the cache limits off" matches the main change in the changeset. The PR adds a sentence to the WP_CLI_CACHE_EXPIRY and WP_CLI_CACHE_MAX_SIZE entries in references/config.md. The sentence states that since WP-CLI 3.0.0, setting either limit to 0 turns it off. The title is specific and identifies the primary change. It is short and free of file lists, emojis, or vague terms.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1bc14e07-d788-4181-809b-2905ef262b5a
Commits

Reviewing files that changed from the base of the PR and between 7fb7dd2 and 5826bc4.

Files selected for processing: 1

  • references/config.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@schlessera
schlessera merged commit aa563e1 into wp-cli:main Dec 1, 2026
8 checks passed
@schlessera schlessera added this to the 3.0.0 milestone Dec 1, 2026 — with schlessera-agent-fleet
@ekamran
ekamran deleted the shifteq/cache-limit-zero branch December 1, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants