Information-Centric Networking (ICN) is the emerging next-generation internet paradigm. The Low Earth Orbit (LEO) satellite mega-constellation based on ICN can achieve seamless global coverage and provide excellent support for Internet of Things (IoT) services. Additionally, in-network caching, typically characteristic of ICN, plays a paramount role in network performance. Therefore, the in-network caching policy is one of the hotspot problems. Especially, compared to caching traditional internet content, in-networking caching IoT content is more challenging, since the IoT content lifetime is small and transient. In this paper, firstly, the framework of the LEO satellite mega-constellation Information-Centric Networking for IoT (LEO-SMC-ICN-IoT) is proposed. Then, introducing the concept of "viscosity", the proposed Caching Algorithm based on the Random Forest (CARF) policy of satellite nodes combines both content popularity prediction and satellite nodes location prediction, for achieving good cache matching between the satellite nodes and content. And using the matching rule, the Random Forest (RF) algorithm is adopted to predict the matching relationship among satellite nodes and content for guiding the deployment of caches. Especially, the content is cached in advance at the future satellite to maintain communication with the current ground segment at the time of satellite switchover. Additionally, the policy considers both the IoT content lifetime and the freshness. Finally, a simulation platform with LEO satellite mega-constellation based on ICN is developed in Network Simulator 3 (NS-3). The simulation results show that the proposed caching policy compared with the Leave Copy Everywhere (LCE), the opportunistic (OPP), the Leave Copy down (LCD), and the probabilistic algorithm which caches each content with probability 0.5 (prob 0.5) yield a significant performance improvement, such as the average number of hops, i.e., delay, cache hit rate, and throughput.