I am integrating LDAP authentication in my web enterprise application. I would like to show listing of people name and email. Instead of querying the LDAP server for the name and email each time a listing containing several users I thought about caching the data locally in the database.
Do you guys know about caching LDAP data best practices?
Should I cache LDAP user data?
When should I insert and refresh the data?
I did the same thing when developping web applications with LDAP authentication.
Each time a user logs in, I retrieve his LDAP uid and checks if it is in the database. If not, I get user information from LDAP, in your case : name, surname (?) and email. Then insert it in the user table of the database.
The user table schema should look like this :
________________
| User |
________________
| - id |
| - ldap_uid |
| - name |
| - first_name |
| - mail |