Coded caching utilizes proper file subpacketization and coded delivery to make full use of the multicast opportunities in content delivery, to alleviate file transfer load in massive content delivery scenarios. Most existing work considers deterministic environments. An important practical topic is to characterize the impact of the uncertainty from user inactivity on coded caching. We consider a one server cache-enabled network under homogeneous file and network settings in presence of user inactivity. Unlike random or probabilistic caching studied in the literature, deterministic coded caching is considered, with the objective to minimize the worst-case backhaul load by optimizing the file subpacketization and the caching strategy. First, a coded caching method is used, where each file is split into the same type of fragments labeled using sets with fixed cardinality, and the optimality of the selected cardinality is proved. Optimal file subpacketization by splitting the file into multiple types of fragments labeled with multiple cardinalities is then discussed. We show that the closed-form optimum turns out to be given by a fixed cardinality-optimizing for user inactivity only affects file delivery, cache placement is not affected. A decentralized version is also discussed and analyzed, where each user fills its storage independently at random without centralized coordination, and user inactivity is taken into account in file delivery. Simulation results show that the optimization based centralized coded caching scheme provides performance comparable to the ideal scenario assuming full knowledge of user inactivity in the placement phase, while decentralized caching performs slightly worse against user inactivity.