Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

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

[Cache] "vary" prop from Cache attribute doesn't work when inferring Locale from Accept-Language #58663

Closed as not planned
@cdaguerre

Description

@cdaguerre

Symfony version(s) affected

7.1.0

Description

Cache attribute'svary property is silently ignored with following config:

framework:set_locale_from_accept_language:true

And following controller

useSymfony\Component\HttpFoundation\JsonResponse;useSymfony\Component\HttpKernel\Attribute\Cache;class SomeController{    #[Cache(smaxage:3600, vary: ['X-Some-Header'])]publicfunctionindex():Response    {returnnewJsonResponse("OK");    }}

TheLocaleListener adds an attribute to the request that is used by theResponseListener to add aVary: Accept-Language header.
However, this occurs before theCacheAttributeListener, which doesn't take the attribute'svary property into account if there is already aVary header on the response.

Is this expected?

How to reproduce

See above.

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp