Make cache configurable
Allow for custom criteria