How would you design and implement a custom cache mechanism that supports fast lookups and efficient eviction policies?