When a user is already logged in, the Security component keeps reloading data from the user provider on every reqyest. Is there a way to avoid this? When your user provider is not in a local database, for example, in a webservice, this can dramatically slow down the system.
On every request i get this:
[2012-08-15 20:07:30] security.DEBUG: Read SecurityContext from the session [] []
[2012-08-15 20:07:30] security.DEBUG: Reloading user from user provider. [] []
You can decide wether or not to refresh your user for each request depending on your needs by overriding the refreshUser
method of the UserProviderInterface
implementation you rely on from a given security context.
Please refer to the following API documentation:
UserProviderInterface.html#method_refreshUser
It is up to the implementation to decide if the user data should be totally reloaded (e.g. from the database), or if the UserInterface object can just be merged into some internal array of users / identity map.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With