Use a deque for the master cache instead of a list