Optimizing Content Caching and Availability