Skip to content

Commit 1c402b6

Browse files
committed
minor #16445 [Cache] 45036 add stale while revalidate and stale if error support (remieuronews)
This PR was submitted for the 5.4 branch but it was merged into the 6.1 branch instead. Discussion ---------- [Cache] 45036 add stale while revalidate and stale if error support <html> <body> <!--StartFragment--> Q | A -- | -- Branch? | 5.4 Bug fix? | no New feature? | yes Deprecations? | no Tickets | - License | MIT Doc PR | - <!--EndFragment--> </body> </html> This PR allow support for RFC5861. Meaning you can now use stale_while_revalidate and stale_if_error https://httpwg.org/specs/rfc5861.html Very interesting doc from Fastly on the subject: https://developer.fastly.com/learning/concepts/stale/ Commits ------- 995b2e6 [cache] 45036 add stale while revalidate and stale if error support
2 parents 529ade0 + 995b2e6 commit 1c402b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/http_foundation.rst

+4
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@ of methods to manipulate the HTTP headers related to the cache:
479479
* :method:`Symfony\\Component\\HttpFoundation\\Response::setExpires`
480480
* :method:`Symfony\\Component\\HttpFoundation\\Response::setMaxAge`
481481
* :method:`Symfony\\Component\\HttpFoundation\\Response::setSharedMaxAge`
482+
* :method:`Symfony\\Component\\HttpFoundation\\Response::setStaleIfError`
483+
* :method:`Symfony\\Component\\HttpFoundation\\Response::setStaleWhileRevalidate`
482484
* :method:`Symfony\\Component\\HttpFoundation\\Response::setTtl`
483485
* :method:`Symfony\\Component\\HttpFoundation\\Response::setClientTtl`
484486
* :method:`Symfony\\Component\\HttpFoundation\\Response::setLastModified`
@@ -506,6 +508,8 @@ call::
506508
'proxy_revalidate' => false,
507509
'max_age' => 600,
508510
's_maxage' => 600,
511+
'stale_if_error' => 86400,
512+
'stale_while_revalidate' => 60,
509513
'immutable' => true,
510514
'last_modified' => new \DateTime(),
511515
'etag' => 'abcdef',

0 commit comments

Comments
 (0)