Write a function to optimize a data retrieval process.
Given a known sequence of item requests and a fixed-size cache, return the minimum number of backend retrievals needed. You may evict cached items, and a request is a cache hit when its item is already stored.
Implement def optimize_data_retrieval(requests, cache_capacity):, returning an integer. Use the optimal offline eviction strategy: when the cache is full, evict the cached item whose next request occurs farthest in the future, or that is never requested again.
def optimize_data_retrieval(requests, cache_capacity):