Best practices for photos

I communicate to an AC system through TCP. For things to be scalable, I think I should I save photos to RAM right? Do you guys do any caching? Should I save to disk also to avoid having to recover pictures through TCP everytime the event server restarts? Caching to RAM can be a problem if the system has too many users… Also, when an AC page loads it recovers the same image multiple times even if the same credholder ID is used…

The short answer is yes, we do cache credential holders (and their picture data) – controlled by these two configuration parameters for the Event Server:

Ok nice1. So it will stay cached even if the even server restarts?

Is there a way to know if the image is cached or not? I have to cache the images myself in ram right now to avoid pulling them from the access control system each time…

Putting “null” in the ACCredential holder will get the cached image?

The Event Server cache is an in-memory cache only.

The Event Server requests credential holder data (including picture data) from your ACM plugin. Within the Event Server, these credential holders are then cached, so if the same credential holder is needed, it will be taken from the Event Server cache (as long as this credential holder is in the Event Server cache), so your ACM plugin will not be queried for this credential holder.

So in general, there should be no need for having another in-memory cache of credential holders in the ACM plugin. Instead, the Event Server cache should be tuned (via the configuration parameters mentioned above) to match the expected usage.

I had to create a local disk cache to speed it up. Everytime the event server restarted it would lose the cache and take forever to get images from the socket.

My advice, always create a cache on local hard drive or on a NAS/SAN.