minor #21654 [HttpKernel] Split cache examples (as it's not repeatable) (tcoch)

This PR was merged into the 6.4 branch.

Discussion
----------

[HttpKernel] Split cache examples (as it's not repeatable)

Since `#[Cache]` attribute is not repeatable, I propose to correct the example in the doc with this new version in order to avoid in confusion

Commits
-------

b9cec7864 Split cache examples
This commit is contained in:
Javier Eguiluz
2026-01-05 16:46:17 +01:00

View File

@@ -41,8 +41,13 @@ attribute::
// ...
#[Cache(vary: ['Accept-Encoding'])]
public function foo(): Response
{
// ...
}
#[Cache(vary: ['Accept-Encoding', 'User-Agent'])]
public function index(): Response
public function bar(): Response
{
// ...
}