Caching popular contents at edge devices is an effective solution to alleviate the burden of the backhaul networks. Earlier investigations commonly neglected the storage cost in caching. More recently, retention-aware caching, where both the downloading cost and storage cost are accounted for, is attracting attention. Motivated by this, we address proactive and retention-aware caching problem with the presence of user mobility, optimizing the sum of the two types of costs. More precisely, a cost-optimal caching problem for vehicle-to-vehicle networks is formulated with joint consideration of the impact of the number of vehicles, cache size, storage cost, and content request probability. This is a combinatorial optimization problem. However, we derive a stream of analytical results and they together lead to an algorithm that guarantees global optimum with polynomial-time complexity. Numerical results show significant improvements in comparison to popular caching and random caching.