A generic lookup cache implementation