Caching plays an important role in improving the quality of data access. Replacement algorithm optimization is the core of caching model research. First, independent reference model and Markov reference model are analyzed and compared in this paper. Then, based on the measurement of relative popularity and byte cost, optimal Web caching model and corresponding algorithms that satisfy different performance metrics are presented. Simulations and analysis show that the optimal algorithms outperform the existed Web cache replacement algorithms in corresponding performance.