In WiFi-based content distribution community infrastructure (CDCI), file servers are deployed in diverse locations around cities, caching popular files interesting to a community. They serve file download requests from mobile users in proximity via WiFi. In this paper, we study the optimal caching strategy for file servers in CDCI so that file retrieval probability within deadline is maximized, subject to storage constraint of each file server. The optimal caching strategy depends on many factors, such as users’ mobility patterns, access point topology, file popularity, etc. We have formalized this content management problem as a mixed integer optimization problem. Because of NP-hardness and a large variable space of this optimization problem, we propose a heuristic algorithm MobaSsign to allocate file blocks. Extensive experiments show that our heuristic caching strategy considering mobility patterns improves the file retrieval probability within deadline.