Commit Graph

229 Commits

Author SHA1 Message Date
Wouter de Jong
34cbd3eea1 [Components] Convert to native return types 2023-07-05 15:06:06 +02:00
Frank Fiebig
08c0866859 [Lock] 7.0 remove deprecations in Lock Component 2023-07-05 10:10:07 +02:00
Nicolas Grekas
fc9fbac1f1 Merge branch '6.2' into 6.3
* 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
2023-05-05 17:55:45 +02:00
Nicolas Grekas
ceebcf9397 Merge branch '5.4' into 6.2
* 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
2023-05-05 17:52:57 +02:00
Nicolas Grekas
d6e45e4ed7 [HttpKernel] Fix restoring surrogate content from cache 2023-05-05 15:22:42 +02:00
Fabien Potencier
047a4ce39a Merge branch '5.4' into 6.2
* 5.4:
  [HttpKernel] Don't use eval() to render ESI/SSI
2023-05-05 13:02:22 +02:00
Nicolas Grekas
568365cfe7 [HttpKernel] Don't use eval() to render ESI/SSI 2023-05-04 14:19:30 +02:00
Nicolas Grekas
f4e575b0f8 [HttpKernel] Don't use eval() to render ESI/SSI 2023-04-17 11:36:41 +02:00
Yanick Witschi
eaf1f26a45 [HttpKernel] Add skip_response_headers to the HttpCache options 2023-02-21 13:49:38 +01:00
Nicolas Grekas
8ec609e2c9 Merge branch '6.2' into 6.3
* 6.2:
  CS fix
  Fix test provider
2023-02-16 11:14:28 +01:00
Wouter de Jong
8efef814fc Add void return types 2023-02-13 14:18:23 +01:00
Christian Flothmann
6954696846 Merge branch '5.4' into 6.2
* 5.4:
  fix test
  [Response] `getMaxAge()` returns non-negative integer
2023-02-04 11:17:16 +01:00
pkruithof
820ae32996 [Response] getMaxAge() returns non-negative integer 2023-02-04 09:34:22 +01:00
Nicolas Grekas
8ada246e3b Use ??= more 2022-11-02 10:08:04 +01:00
matheo
b88571e087 Ban DateTime from the codebase 2022-10-09 10:55:40 +02:00
Grégoire Pineau
3b05051d9e [CS] Remove @inheritdoc PHPDoc 2022-08-25 17:27:04 +02:00
Fabien Potencier
4e86044dfa feature #46763 [HttpCache] Do not call terminate() on cache hit (Toflar)
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
2022-06-27 08:18:36 +02:00
Nicolas Grekas
36fcfd8ccc Merge branch '6.0' into 6.1
* 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
2022-06-26 18:35:04 +02:00
Nicolas Grekas
8b1bce2319 Merge branch '5.4' into 6.0
* 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
2022-06-26 18:34:50 +02:00
Nicolas Grekas
4e46b3abc6 Merge branch '4.4' into 5.4
* 4.4:
  [HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache
  [Serializer] Fix denormalization union types with constructor
2022-06-26 18:30:39 +02:00
Matthias Pigulla
546634a85c [HttpKernel] Fix a PHP 8.1 deprecation notice in HttpCache 2022-06-26 18:26:10 +02:00
Yanick Witschi
f0fd041a26 [HttpCache] Do not call terminate() on cache hit 2022-06-25 22:28:08 +02:00
Nicolas Grekas
da802b6efc Bump minimum version of PHP to 8.1 2022-02-25 12:15:52 +01:00
Nicolas Grekas
5bba3f4ff0 Add more nullsafe operators 2021-12-16 23:15:42 +01:00
Alexander M. Turek
4c996585cb Make use of the nullsafe operator 2021-12-13 21:40:50 +01:00
Fabien Potencier
9c9c39041c Remove FQCN type hints on properties 2021-12-08 16:13:44 +01:00
Alexander M. Turek
180f95177c [HttpKernel] Add types to private properties
Signed-off-by: Alexander M. Turek <me@derrabus.de>
2021-09-07 12:43:05 +02:00
Nicolas Grekas
d5b7138829 Merge branch '5.4' into 6.0
* 5.4:
  Fix skip condition for INTL
  [Messenger] Fix `ErrorDetailsStamp` denormalization
  [Translation] Extract translatable content on twig set
  Simplify code
  [FrameworkBundle] Add BrowserKitAssertionsTrait::assertThatForBrowser
  Fix composer.json versions
  [Ldap] Fixing the behaviour of getting LDAP Attributes
  Fix composer.json versions
  Remove redundant license info
  [HttpFoundation] Fix isNotModified determination logic
  Fix Url Validator false positives
  [Translation] Reverse fallback locales
  [Console] Backport minor refactorings
  [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values
  notifier smsapi - fixed checking whether message is sent
  allow null for framework.translator.default_path
  improve failure messages of the CrawlerSelectorTextContains constraint
2021-08-26 10:28:23 +02:00
Nicolas Grekas
ae124bf6f1 Merge branch '5.3' into 5.4
* 5.3:
  Fix skip condition for INTL
  [Messenger] Fix `ErrorDetailsStamp` denormalization
  [Translation] Extract translatable content on twig set
  Simplify code
  Fix composer.json versions
  Fix composer.json versions
  Remove redundant license info
  [HttpFoundation] Fix isNotModified determination logic
  Fix Url Validator false positives
  [Translation] Reverse fallback locales
  [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values
  notifier smsapi - fixed checking whether message is sent
  allow null for framework.translator.default_path
  improve failure messages of the CrawlerSelectorTextContains constraint
2021-08-26 10:23:47 +02:00
Nicolas Grekas
d97a656067 Merge branch '4.4' into 5.3
* 4.4:
  Fix composer.json versions
  Fix composer.json versions
  Remove redundant license info
  [HttpFoundation] Fix isNotModified determination logic
  Fix Url Validator false positives
  [Translation] Reverse fallback locales
  [FrameworkBundle] Fall back to default configuration in debug:config and consistently resolve parameter values
  allow null for framework.translator.default_path
  improve failure messages of the CrawlerSelectorTextContains constraint
2021-08-26 10:22:53 +02:00
Fabien Potencier
6593d789dd Remove redundant license info 2021-08-26 08:31:37 +02:00
Volker Killesreiter
db4eefc6e3 [HttpFoundation] Fix isNotModified determination logic 2021-08-26 08:29:03 +02:00
Nicolas Grekas
9a4e1c0030 Merge branch '5.4' into 6.0
* 5.4:
  [Serializer] cs fix
  Cleanup more `@return` annotations
  [Form] Fix phpdoc on FormBuilderInterface
2021-08-17 17:35:52 +02:00
Nicolas Grekas
1b8585c7d3 Cleanup more @return annotations 2021-08-17 16:20:01 +02:00
Nicolas Grekas
e47a3e656d Add return types - batch 6/n 2021-08-16 17:45:02 +02:00
Nicolas Grekas
6a1fa09ff1 Cleanup @return annotations 2021-08-12 11:55:17 +02:00
Alexander M. Turek
d026426847 Rename master request to main request 2021-03-22 14:14:48 +01:00
Nicolas Grekas
2e1aa09438 Merge branch '4.4' into 5.0
* 4.4:
  [Validator] fix access to uninitialized property when getting value
  [HttpClient] Fix regex bearer
  [Translator] Default value for 'sort' option in translation:update should be 'asc'
  [HttpKernel] Fix stale-if-error behavior, add tests
  [Intl] Provide more locale translations
  [Mailer] Fix STARTTLS support for Postmark and Mandrill
  [Messenger] Check for all serialization exceptions during message dec…
  [Messenger] Fix bug when using single route with XML config
  Fix exception message in Doctrine Messenger
  [DI]  CheckTypeDeclarationsPass now checks if value is type of parameter type
  [SecurityBundle] fix security.authentication.provider.ldap_bind arguments
  Improved error message when no supported user provider is found
  Mysqli doesn't support the named parameters used by PdoAdapter
  Added debug argument to decide if debug page should be shown or not
  Mysqli doesn't support the named parameters used by PdoStore
  Properly handle phpunit arguments for configuration file
  [Mailer] add tests for http transports
2020-01-31 10:13:47 +01:00
Nicolas Grekas
7e0a993282 Merge branch '4.3' into 4.4
* 4.3:
  [Validator] fix access to uninitialized property when getting value
  [HttpClient] Fix regex bearer
  [HttpKernel] Fix stale-if-error behavior, add tests
  Improved error message when no supported user provider is found
  Properly handle phpunit arguments for configuration file
2020-01-31 10:11:17 +01:00
Nicolas Grekas
972b421060 Merge branch '3.4' into 4.3
* 3.4:
  [Validator] fix access to uninitialized property when getting value
  [HttpKernel] Fix stale-if-error behavior, add tests
  Improved error message when no supported user provider is found
2020-01-31 10:10:37 +01:00
Matthias Pigulla
84023e41c8 [HttpKernel] Fix stale-if-error behavior, add tests 2020-01-30 17:05:53 +01:00
Nicolas Grekas
84edb54d0d Merge branch '4.4' into 5.0
* 4.4:
  [DI] Fix EnvVar not loaded when Loader requires an env var
  Fixed #34713 Move new messages to intl domain when possible
  [FrameworkBundle] Fix small typo in output comment
  chown and chgrp should also accept int as owner and group
  Revert "Fixed translations file dumper behavior"
  Fix RememberMe with null password
  [Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
  Set booted flag to false when test kernel is unset
  [FrameworkBundle] remove messenger cache if not enabled
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
  [HttpClient] Fix strict parsing of response status codes
  fix PHP const mapping keys using the inline notation
  [SecurityBundle] Drop duplicated code
  [FrameworkBundle] Make sure one can use fragments.hinclude_default_template
  Fix that no-cache requires positive validation with the origin, even for fresh responses
  Improve upgrading instructions for deprecated router options
  [DI] Suggest typed argument when binding fails with untyped argument
2020-01-21 09:40:24 +01:00
Fabien Potencier
0fce877d9b Merge branch '4.3' into 4.4
* 4.3:
  chown and chgrp should also accept int as owner and group
  Fix RememberMe with null password
  [Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
  fix PHP const mapping keys using the inline notation
  Fix that no-cache requires positive validation with the origin, even for fresh responses
2020-01-21 09:20:44 +01:00
Fabien Potencier
0ef0c2083c Merge branch '3.4' into 4.3
* 3.4:
  chown and chgrp should also accept int as owner and group
  Fix RememberMe with null password
  [Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
  [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
  fix PHP const mapping keys using the inline notation
  Fix that no-cache requires positive validation with the origin, even for fresh responses
2020-01-21 09:20:29 +01:00
Matthias Pigulla
6262649377 Fix that no-cache requires positive validation with the origin, even for fresh responses 2020-01-10 22:32:00 +00:00
Robin Chalas
6e79182f4b Merge branch '4.4' into 5.0
* 4.4: (38 commits)
  reset the kernel cache after each test
  [HttpKernel] Ability to define multiple kernel.reset tags
  [Routing] Continue supporting single colon in object route loaders
  [FWBundle] Remove unused parameter
  [Intl] [Workflow] fixes English grammar typos
  [Filesystem] [Serializer] fixes English grammar typo
  mailer: mailchimp bridge is throwing undefined index _id when setting message id in mandrill http transport
  has_roles should be is_granted in upgrade files
  [HttpClient] Fix early cleanup of pushed HTTP/2 responses
  skip test on incompatible PHP versions
  [HttpKernel] Don't cache "not-fresh" state
  [FrameworkBundle][Cache] Don't deep-merge cache pools configuration
  [Messenger] Adding exception to amqp transport in case amqp ext is not installed
  [SecurityBundle] Don't require a user provider for the anonymous listener
  [Monolog Bridge] Fixed accessing static property as non static.
  Improve Symfony description
  [Mailer] Add UPGRADE entries about Envelope and MessageEvent
  [FrameworkBundle] fix leftover mentioning "secret:" processor
  Add DateTimeZoneNormalizer into Dependency Injection
  [Messenger] Error when specified default bus is not among the configured
  ...
2019-11-27 00:25:11 +01:00
Robin Chalas
81b3bb8704 Merge branch '4.3' into 4.4
* 4.3:
  [FWBundle] Remove unused parameter
  [Intl] [Workflow] fixes English grammar typos
  [Filesystem] [Serializer] fixes English grammar typo
  [Messenger] Adding exception to amqp transport in case amqp ext is not installed
  [Monolog Bridge] Fixed accessing static property as non static.
  Improve Symfony description
  Add DateTimeZoneNormalizer into Dependency Injection
  [Messenger] Error when specified default bus is not among the configured
  [Validator] Add Japanese translation
  [Workflow] Apply the same logic of precedence between the apply() and the buildTransitionBlockerList() method
  Remove some unused methods parameters
  Avoid empty \"If-Modified-Since\" header in validation request
  [Security] Fix SwitchUser is broken when the User Provider always returns a valid user
  Fix error message according to the new regex
  compatibility with DoctrineBundle 2
  [Validator] ConstraintValidatorTestCase: add missing return value to mocked validate method calls
2019-11-27 00:16:41 +01:00
Fabien Potencier
2127891f48 Merge branch '3.4' into 4.3
* 3.4:
  [Filesystem] [Serializer] fixes English grammar typo
  [Monolog Bridge] Fixed accessing static property as non static.
  Improve Symfony description
  [Validator] Add Japanese translation
  Remove some unused methods parameters
  Avoid empty \"If-Modified-Since\" header in validation request
  [Validator] ConstraintValidatorTestCase: add missing return value to mocked validate method calls
2019-11-26 04:44:44 +01:00
Matthias Pigulla
27d5069c08 Avoid empty \"If-Modified-Since\" header in validation request 2019-11-23 16:07:54 +01:00
Philippe Segatori
8b25bb90f3 Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00