Emerging in-vehicle applications seek to improve travel experiences, but the rising number of vehicles results in more computational tasks and redundant content requests, leading to resource waste. Efficient compute offloading and content caching strategies are crucial for the Internet of Vehicles (IoV) to optimize performance in time latency and energy consumption. This paper proposes a joint task offloading and content caching optimization method based on forecasting traffic streams, called TOCC. First, temporal and spatial correlations are extracted from the preprocessed dataset using the Forecasting Open Source Tool (FOST) and integrated to predict the traffic stream to obtain the number of tasks in the region at the next moment. To obtain a suitable joint optimization strategy for task offloading and content caching, the multi-objective problem of minimizing delay and energy consumption is decomposed into multiple single-objective problems using an improved Multi-Objective Evolutionary Algorithm based on Decomposition (MOEA/D) via the Tchebycheff weight aggregation method, and a set of Pareto-optimal solutions is obtained. Finally, the experimental results verify the effectiveness of the TOCC strategy. Compared with other methods, its latency is up to 29% higher and its energy consumption is up to 83% higher.