Skip to content

Commit acdb2ce

Browse files
Clarify #[Cache] attribute precedence behavior
Adds tip explaining that #[Cache] attribute doesn't override manually set headers. Related to #62488
1 parent 26ad0a6 commit acdb2ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

http_cache.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ Thanks to this new code, your HTTP response will have the following header:
235235
236236
Cache-Control: public, maxage=3600, must-revalidate
237237
238+
.. tip::
239+
240+
When both are used, the cache headers defined in the controller take precedence over those configured with the `#[Cache]` attribute.
241+
238242
This tells your HTTP reverse proxy to cache this response for 3600 seconds. If *anyone*
239243
requests this URL again before 3600 seconds, your application *won't* be hit at all.
240244
If you're using the Symfony reverse proxy, look at the ``X-Symfony-Cache`` header

0 commit comments

Comments
 (0)