We consider a content delivery problem in which jobs are processed in batches and may abandon before their service has been initiated. We model the problem as a Markovian single-server queue and analyze two different settings: (1) the system is cleared as soon as the server is activated, i.e., service rate μ = ∞, and (2) the service speed is exponentially distributed with rate μ < ∞. The objective is to determine the optimal clearing strategy that minimizes the average cost incurred by holding jobs in the queue, having jobs renege, and performing setups. This last cost is incurred upon activation of the server in the case μ = ∞, and per unit of time the server is active otherwise. Our first contribution is to prove that policies of threshold type are optimal in both frameworks. In order to do so we have used the Smoothed Rate Truncation method which overcomes the problem arising from unbounded transition rates. For our second contribution, we derive the steady-state job-length distribution under threshold policies. The latter yields a characterization of the optimal threshold strategy, which can be easily implemented. Finally, we present numerical results for our solution across a wide range of parameters. We show that the performance of nonoptimal threshold policies can be very poor, which highlights the importance of computing the optimal threshold.