collective / pas.plugins.ldap

Zope (and Plone) PAS Plugin providing users and groups from LDAP directory
http://pypi.python.org/pypi/pas.plugins.ldap
Other
13 stars 20 forks source link

Optimizations #110

Open ale-rt opened 3 years ago

ale-rt commented 3 years ago

I am reporting quickly what I found. When I finished my assessment I will make this issue look better!

Replace

if request and rcachekey in list(request.keys()):
     return request[rcachekey]
return VALUE_NOT_CACHED

with something like:

return (request or {}).get(rcachekey, VALUE_NOT_CACHED)

or at list replace rcachekey in list(request.keys()) with rcachekey in request.

Also this does not work for subrequests: I see multiple connections for every tile I use and for the diazo compilation. Caching the connection in memcached might be better. BTW I do not know if I have the plugin improperly configured ;)

jensens commented 2 years ago

subrequests indeed. we should get the root-parent first in a non expensive way

ale-rt commented 2 years ago

Thanks @jensens for moving this forward