The development of the Internet of Vehicles (IoV) enables numerous emerging in-vehicle applications to accommodate users with various contents, thus enhancing their traveling experiences. In IoV, content decoding tasks are typically offloaded to edge servers for implementation, as edge computing is an admirable paradigm to provide low-latency services. However, as different vehicular users may request the same contents, processing these contents repeatedly leads to the waste of storage, computation and bandwidth resources. Therefore, fine-grained computation offloading and content caching are demanded in IoV. In this paper, a joint optimization method for computation offloading and content caching based on traffic flow prediction, named COC, is proposed. Firstly, traffic flow covered by each edge server is predicted by a modified deep spatiotemporal residual network (ST-ResNet). Secondly, the non-dominated sorting genetic algorithm III (NSGA-III) is leveraged to realize the many-objective optimization to shorten the execution time and reduce the energy consumption of computation and transmission in IoV. Finally, evaluated by real-world big data from Nanjing China, COC shows a great reduction in execution time and energy consumption of transmission and computation compared to other methods.