Adding optional (and default) caching to lookup queries