Skip to content

Conversation

@michalsn
Copy link
Member

Description
This PR introduces a new configuration property, Config\Cache::$cacheStatusCodes, which allows developers to explicitly control which HTTP response status codes are cached.

This is important because not all responses should be cached by default. In practice, applications may want to cache responses beyond 200 OK (for example, 404), or the opposite - prevent caching of certain status codes to avoid serving stale or misleading responses. Making this configurable gives developers good control over cache behavior.

Minor BC break:
The PageCache filter constructor now accepts an optional Cache parameter to allow dependency injection (primarily for testing). This should not affect most users, as the parameter has a default value and existing usage continues to work unchanged.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn added enhancement PRs that improve existing functionalities breaking change Pull requests that may break existing functionalities 4.7 labels Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.7 breaking change Pull requests that may break existing functionalities enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant