* 7.3:
Fix-type-error-when-revealing-broken-secret
fix compatibility with Relay 0.11
[Security] Handle non-callable implementations of `FirewallListenerInterface`
[DomCrawler] Allow selecting `button`s by their `value`
flip excluded properties with keys with Doctrine-style constraint config
[JsonPath] Test against official compliance test suite
Silence E_DEPRECATED and E_USER_DEPRECATED
[HttpCache] Hit the backend only once after waiting for the cache lock
fix compatibility with Symfony 7.4
[Form] Keep submitted values when keep_as_list option of collection type is enabled
[Form] Fix `keep_as_list` when data is not an array
[JsonPath] Fix subexpression evaluation in filters
[JsonPath] Fix support for comma separated indices
* 6.4:
Silence E_DEPRECATED and E_USER_DEPRECATED
[HttpCache] Hit the backend only once after waiting for the cache lock
fix compatibility with Symfony 7.4
* 7.1:
fix: ignore missing directory in isVendor()
[OptionsResolver] Allow Union/Intersection Types in Resolved Closures
Issue #58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass().
Dynamically fix compatibility with doctrine/data-fixtures v2
[HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
don't call EntityManager::initializeObject() with scalar values
make RelayProxyTrait compatible with relay extension 0.9.0
[Validator] review italian translations
Update PR template
* 5.4:
Issue #58821: [DependencyInjection] Support interfaces in ContainerBuilder::getReflectionClass().
Dynamically fix compatibility with doctrine/data-fixtures v2
[HttpKernel] Ensure HttpCache::getTraceKey() does not throw exception
don't call EntityManager::initializeObject() with scalar values
[Validator] review italian translations
Update PR template
* 7.1:
remove custom CSV escape character from tests
[HttpKernel] ESI fragment content may be missing in conditional requests
[SecurityBundle] Revert adding `_stateless` attribute to the request when firewall is stateless and the attribute is not already set
fix compatibility with Twig 3.12 and 4.0
Improve and add tests for Last-Modified computation with ESI responses
* 6.4:
remove custom CSV escape character from tests
[HttpKernel] ESI fragment content may be missing in conditional requests
[SecurityBundle] Revert adding `_stateless` attribute to the request when firewall is stateless and the attribute is not already set
fix compatibility with Twig 3.12 and 4.0
Improve and add tests for Last-Modified computation with ESI responses
* 7.0:
List CS fix in .git-blame-ignore-revs
Fix implicitly-required parameters
minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
Fix bad merge
List CS fix in .git-blame-ignore-revs
Fix implicitly-required parameters
List CS fix in .git-blame-ignore-revs
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
[Messenger][AmazonSqs] Allow async-aws/sqs version 2
* 6.4:
Fix implicitly-required parameters
minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench)
Fix bad merge
List CS fix in .git-blame-ignore-revs
Fix implicitly-required parameters
List CS fix in .git-blame-ignore-revs
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
[Messenger][AmazonSqs] Allow async-aws/sqs version 2
* 6.2:
Do not check errored definitions’ type
[HttpKernel] Fix restoring surrogate content from cache
[HttpKernel] Do not reset lazy services if they are not initialized
[HttpClient] Fix getting through proxies via CONNECT
Remove legacy filters remnants
* 5.4:
Do not check errored definitions’ type
[HttpKernel] Fix restoring surrogate content from cache
[HttpClient] Fix getting through proxies via CONNECT
Remove legacy filters remnants
This PR was merged into the 6.2 branch.
Discussion
----------
[HttpCache] Do not call terminate() on cache hit
| Q | A
| ------------- | ---
| Branch? | 6.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | -
Currently, `HttpCache` always calls the `kernel.terminate` events, even if the response is coming from cache.
Why is this a problem?
`kernel.terminate` events are used to do things after the response has been sent to the visitor. At least that happens if you have support for `fastcgi_finish_request()`.
For Contao for example, we use this to dispatch a message to update the search index but you can imagine a lot of stuff being done there, like sending e-mails etc. According [to the docs](https://symfony.com/doc/current/components/http_kernel.html#8-the-kernel-terminate-event), it says "perform some heavy action".
This means that currently, the system is basically always booted even when the response is coming from `HttpCache` because dispatching the `TerminateEvent` causes the container to be booted etc. which makes the system slower than it needs to be.
We don't need to update the search index when the response is coming from the cache because it already is up to date. And there are no e-mails or other "heavy actions" to perform because by definition, nothing could've happened as the system was not booted (or should not have been).
Also, imagine if you used a "real" reverse proxy like Varnish. There's no call to the back end either when there's a cache hit so it's actually an inconsistency. You cannot "perform some heavy action" there either. If you wanted to, it would have to be implemented in the proxy itself. So Varnish would need to trigger that heavy action. HttpCache should behave just the same.
You could e.g. use the `EventDispatchingHttpCache` from https://github.com/FriendsOfSymfony/FOSHttpCache, if you need something like that.
Commits
-------
662eb17cb7 [HttpCache] Do not call terminate() on cache hit
* 6.0:
[HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache
Add an invariable word in french
[Serializer] Fix denormalization union types with constructor
* 5.4:
[HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache
Add an invariable word in french
[Serializer] Fix denormalization union types with constructor