Skip to content

fix(cachetags): gate Kinsta on the WP_ENVIRONMENT_TYPE constant, prune after 400d - #501

Merged
oxyc merged 1 commit into
masterfrom
fix/cachetags-template-env-prune
Nov 17, 2026
Merged

oxyc merged 1 commit into
masterfrom
fix/cachetags-template-env-prune

Conversation

@oxyc

@oxyc oxyc commented Nov 17, 2026

Copy link
Copy Markdown
Member

The template's config/cachetags.php is what new sites start from (/add-cachetags), but it disagreed with the go-live checklist on two points:

  • Kinsta gate: it used wp_get_environment_type(), which turns PHPUnit's test into production, so tests bound the Kinsta invalidator. Now the WP_ENVIRONMENT_TYPE constant, which config/application.php always defines.
  • Prune age: none set, so the library's 30d default applied, while Kinsta's edge can keep a page for about a year. After the prune a cached page can no longer be purged by tag. Now 400d, as on the fleet's sites.

php -l passes.

🤖 Generated with Claude Code

…e after 400d

wp_get_environment_type() turns PHPUnit's 'test' into 'production'. The
template had no prune-older-than, so it used the library's 30d, while
Kinsta's edge can keep a page for about a year.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@oxyc
oxyc merged commit 8f558d6 into master Nov 17, 2026
1 check passed
@oxyc
oxyc deleted the fix/cachetags-template-env-prune branch November 17, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant