Issue 1:
Symfony version(s) affected: 3.4.20 / 4.1.9

After updating from 3.4.19->3.4.20 (or 4.1.8->4.1.9) it is not possible to enable doctrine filters (https://packagist.org/packages/gedmo/doctrine-extensions + https://packagist.org/packages/stof/doctrine-extensions-bundle) in config.yml.

Config which we use:

filters:
soft_deleteable:
class: 'Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter'
enabled: true

During loading the app error is thrown:

(1/1) InvalidArgumentExceptionFilter 'soft_deleteable' does not exist.

in FilterCollection.php line 107
at FilterCollection->enable('soft_deleteable')in ManagerConfigurator.php line 48
at ManagerConfigurator->enableFilters(object(EntityManager))in ManagerConfigurator.php line 34
at ManagerConfigurator->configure(object(EntityManager))in appDevDebugProjectContainer.php line 2714
at appDevDebugProjectContainer->getDoctrine_Orm_DefaultEntityManagerService(false)in appDevDebugProjectContainer.php line 2703
at appDevDebugProjectContainer->ContainerT6xfqgt\{closure}(null, object(EntityManager_9a5be93), 'getMetadataFactory', array(), object(Closure))in EntityManager_9a5be93.php line 38
at Closure->__invoke(null, object(EntityManager_9a5be93), 'getMetadataFactory', array(), object(Closure))in EntityManager_9a5be93.php line 38
at EntityManager_9a5be93->getMetadataFactory()in AbstractManagerRegistry.php line 181
at AbstractManagerRegistry->getManagerForClass('Path\\To\\Entity')in ServiceEntityRepository.php line 30
at ServiceEntityRepository->__construct(object(Registry), 'Path\\To\\Entity')in ServiceEntityRepository.php line 19
at SomeEntityRepository->__construct(object(Registry))in appDevDebugProjectContainer.php line 3313
at appDevDebugProjectContainer->getServiceEntityRepositoryService()in appDevDebugProjectContainer.php line 3243
at appDevDebugProjectContainer->getServiceEntityChasingPaymentServiceService()in appDevDebugProjectContainer.php line 2683
at appDevDebugProjectContainer->getDoctrine_Orm_DefaultEntityListenerResolverService()in appDevDebugProjectContainer.php line 4686
at appDevDebugProjectContainer->getDoctrine_Orm_DefaultConfigurationService()in appDevDebugProjectContainer.php line 2712
at appDevDebugProjectContainer->getDoctrine_Orm_DefaultEntityManagerService(false)in appDevDebugProjectContainer.php line 2703
at appDevDebugProjectContainer->ContainerT6xfqgt\{closure}(null, object(EntityManager_9a5be93), 'getConfiguration', array(), object(Closure))in EntityManager_9a5be93.php line 328
at Closure->__invoke(null, object(EntityManager_9a5be93), 'getConfiguration', array(), object(Closure))in EntityManager_9a5be93.php line 328
at EntityManager_9a5be93->getConfiguration()in ProxyCacheWarmer.php line 51
at ProxyCacheWarmer->warmUp('/var/www/app/default/symfony-standard/app_api/var/cache/dev')in CacheWarmerAggregate.php line 52
at CacheWarmerAggregate->warmUp('/var/www/app/default/symfony-standard/app_api/var/cache/dev')in Kernel.php line 680
at Kernel->initializeContainer()in Kernel.php line 135
at Kernel->boot()in Kernel.php line 195
at Kernel->handle(object(Request))in app_dev.php line 42

Looks like it is related to changes introduced in: https://github.com/symfony/symfony/pull/29369/files

Note: If enabled: true is removed from the config app loads correctly, but it should be possible to have this filter enabled by default.

Issue 2:
I check Request class and seems that there is many methods runs with same arguments again and again.

Like isSecure called 69 times for me and usually result is same, because $this->server and $this->headers usually same for each call. Also as many other methods in this class and class that related. For example 133 call of IpUtils::checkIp4, Request::isFromTrustedProxy and so on.

I think if there is possible to make $this->server and $this->headers kind of frozen (actually they are usually don't changed during script running), than we can cache results of many methods in Request and improve performance.

What do you think?