Added library key cache for improved performance