The Optimal Caching Algorithm